Skip to content

Commit c699137

Browse files
committed
specify Version at build time
1 parent 4111e81 commit c699137

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ jobs:
2121
with:
2222
dotnet-version: '6.0.x'
2323

24+
- name: Set Version Variable
25+
env:
26+
TAG: ${{ github.ref_name }}
27+
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
28+
2429
- name: Restore Packages
2530
run: dotnet restore
2631

2732
- name: Build Solution
28-
run: dotnet build -c Release --no-restore
33+
run: dotnet build -c Release --no-restore /p:Version=$VERSION
2934

3035
- name: Run Tests
3136
run: dotnet test -c Release --no-build --verbosity normal
3237

33-
- name: Set Version Variable
34-
env:
35-
TAG: ${{ github.ref_name }}
36-
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
37-
3838
- name: Pack FeatBit.ServerSdk
39-
run: dotnet pack ./src/FeatBit.ServerSdk/FeatBit.ServerSdk.csproj -c Release --no-restore --no-build --output ${VERSION} /p:Version=$VERSION
39+
run: dotnet pack ./src/FeatBit.ServerSdk/FeatBit.ServerSdk.csproj -c Release --no-restore --no-build --output ${VERSION}
4040

4141
- name: Publish NuGet Package
4242
run: dotnet nuget push ${VERSION}/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)