@@ -3,78 +3,46 @@ name: Release
33on :
44 push :
55 tags :
6- - ' v* '
6+ - " v* "
77
88jobs :
99 build :
1010 runs-on : ubuntu-latest
11-
11+
1212 steps :
13- - uses : actions/checkout@v4
14-
15- - name : Setup .NET
16- uses : actions/setup-dotnet@v4
17- with :
18- dotnet-version : 8.0.x
19-
20- - name : Restore dependencies
21- run : dotnet restore
22-
23- - name : Build
24- run : dotnet build --configuration Release --no-restore /p:Version=${GITHUB_REF#refs/tags/v}
25-
26- - name : Test
27- run : dotnet test --configuration Release --no-build --verbosity normal
28-
29- - name : Publish
30- run : |
31- dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --no-build --output ./publish/win-x64 --runtime win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
32- dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --no-build --output ./publish/linux-x64 --runtime linux-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
33- dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --no-build --output ./publish/osx-x64 --runtime osx-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
34-
35- - name : Create ZIP archives
36- run : |
37- cd ./publish/win-x64 && zip -r ../../dotnet-api-diff-win-x64.zip . && cd ../..
38- cd ./publish/linux-x64 && tar -czf ../../dotnet-api-diff-linux-x64.tar.gz . && cd ../..
39- cd ./publish/osx-x64 && tar -czf ../../dotnet-api-diff-osx-x64.tar.gz . && cd ../..
40-
41- - name : Create Release
42- id : create_release
43- uses : actions/create-release@v1
44- env :
45- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46- with :
47- tag_name : ${{ github.ref }}
48- release_name : Release ${{ github.ref }}
49- draft : false
50- prerelease : false
51-
52- - name : Upload Windows Release Asset
53- uses : actions/upload-release-asset@v1
54- env :
55- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56- with :
57- upload_url : ${{ steps.create_release.outputs.upload_url }}
58- asset_path : ./dotnet-api-diff-win-x64.zip
59- asset_name : dotnet-api-diff-win-x64.zip
60- asset_content_type : application/zip
61-
62- - name : Upload Linux Release Asset
63- uses : actions/upload-release-asset@v1
64- env :
65- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66- with :
67- upload_url : ${{ steps.create_release.outputs.upload_url }}
68- asset_path : ./dotnet-api-diff-linux-x64.tar.gz
69- asset_name : dotnet-api-diff-linux-x64.tar.gz
70- asset_content_type : application/gzip
71-
72- - name : Upload macOS Release Asset
73- uses : actions/upload-release-asset@v1
74- env :
75- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76- with :
77- upload_url : ${{ steps.create_release.outputs.upload_url }}
78- asset_path : ./dotnet-api-diff-osx-x64.tar.gz
79- asset_name : dotnet-api-diff-osx-x64.tar.gz
80- asset_content_type : application/gzip
13+ - uses : actions/checkout@v4
14+
15+ - name : Setup .NET
16+ uses : actions/setup-dotnet@v4
17+ with :
18+ dotnet-version : 8.0.x
19+
20+ - name : Restore dependencies
21+ run : dotnet restore
22+
23+ - name : Build
24+ run : dotnet build --configuration Release --no-restore /p:Version=${GITHUB_REF#refs/tags/v}
25+
26+ - name : Test
27+ run : dotnet test --configuration Release --no-build --verbosity normal
28+
29+ - name : Publish
30+ run : |
31+ dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --output ./publish/win-x64 --runtime win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:Version=${GITHUB_REF#refs/tags/v}
32+ dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --output ./publish/linux-x64 --runtime linux-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:Version=${GITHUB_REF#refs/tags/v}
33+ dotnet publish src/DotNetApiDiff/DotNetApiDiff.csproj --configuration Release --output ./publish/osx-x64 --runtime osx-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:Version=${GITHUB_REF#refs/tags/v}
34+
35+ - name : Create ZIP archives
36+ run : |
37+ cd ./publish/win-x64 && zip -r ../../dotnet-api-diff-win-x64.zip . && cd ../..
38+ cd ./publish/linux-x64 && tar -czf ../../dotnet-api-diff-linux-x64.tar.gz . && cd ../..
39+ cd ./publish/osx-x64 && tar -czf ../../dotnet-api-diff-osx-x64.tar.gz . && cd ../..
40+
41+ - name : Create Release
42+ uses : softprops/action-gh-release@v1
43+ with :
44+ files : |
45+ dotnet-api-diff-win-x64.zip
46+ dotnet-api-diff-linux-x64.tar.gz
47+ dotnet-api-diff-osx-x64.tar.gz
48+ generate_release_notes : true
0 commit comments