Skip to content

Commit 93609ca

Browse files
committed
Add nuget release action
1 parent d5a04d0 commit 93609ca

4 files changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: dotnet release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
env:
8+
VERSION: 0.0.1
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Verify commit exists in origin/master
17+
run: |
18+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
19+
git branch --remote --contains | grep origin/master
20+
21+
- name: Set Version Variable
22+
if: ${{ github.ref_type == 'tag' }}
23+
env:
24+
TAG: ${{ github.ref_name }}
25+
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
26+
27+
- name: Setup .NET 8.0
28+
uses: actions/setup-dotnet@v4
29+
with:
30+
dotnet-version: 8.0.x
31+
32+
- name: Setup .NET 9.0
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: 9.0.x
36+
37+
- name: Restore dependencies
38+
run: dotnet restore
39+
40+
- name: Build
41+
run: dotnet build --no-restore /p:Version=$VERSION
42+
43+
- name: Test
44+
run: dotnet test --no-build --verbosity normal
45+
46+
- name: Pack nuget packages
47+
run: dotnet pack --output nupkgs --no-restore --no-build /p:PackageVersion=$VERSION
48+
49+
- name: Upload nuget package
50+
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
51+
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ fabric.properties
8686
# Android studio 3.1+ serialized cache file
8787
.idea/caches/build_file_checksums.ser
8888

89+
# Nuget assets
90+
/nupkgs

src/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2222
<PackageTags>sql sqlite postgresql entity-framework sqlbulkcopy efcore entity-framework-core sqlserver bulk-insert</PackageTags>
2323
<PackageReadmeFile>README.md</PackageReadmeFile>
24-
<PackageVersion>0.1.0</PackageVersion>
2524
<PackageIcon>icon.png</PackageIcon>
2625
<PackageReleaseNotes>https://github.com/PhenX/PhenX.EntityFrameworkCore.BulkInsert/releases</PackageReleaseNotes>
2726
</PropertyGroup>

tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/PhenX.EntityFrameworkCore.BulkInsert.Benchmark.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
6+
<IsPackable>false</IsPackable>
67
</PropertyGroup>
78

89
<ItemGroup>

0 commit comments

Comments
 (0)