5
5
tags :
6
6
- ' v*'
7
7
8
+ permissions :
9
+ contents : write
10
+ packages : write
11
+
8
12
jobs :
9
13
build :
10
14
runs-on : ubuntu-latest
@@ -29,25 +33,38 @@ jobs:
29
33
- name : Test
30
34
run : dotnet test -c Release --no-build --verbosity normal
31
35
32
- - name : Pack
36
+ - name : Pack all projects
33
37
run : dotnet pack -c Release /p:Version=${{ env.VERSION }} --no-build -o ./nupkg
38
+
39
+ # Pack the CLI tool specifically
40
+ - name : Pack CLI Tool
41
+ run : dotnet pack Smithy.Cli/Smithy.Cli.csproj -c Release /p:Version=${{ env.VERSION }} --no-build -o ./nupkg
34
42
43
+ # Push all NuGet packages
35
44
- name : Push to NuGet
36
- run : dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
45
+ run : dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
37
46
38
47
- name : Create Release
39
48
id : create_release
40
- uses : actions/create-release@v1
41
- env :
42
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
+ uses : softprops/action-gh-release@v1
43
50
with :
44
- tag_name : ${{ github.ref }}
45
- release_name : Release ${{ github.ref_name }}
51
+ name : Release ${{ github.ref_name }}
46
52
draft : false
47
53
prerelease : false
54
+ files : ./artifacts/*.nupkg
55
+ env :
56
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
57
49
- - name : Upload Artifacts
58
+ # Upload the NuGet packages as release assets
59
+ - name : Upload CLI NuGet Package
50
60
uses : actions/upload-release-asset@v1
61
+ env :
62
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63
+ with :
64
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
65
+ asset_path : ./nupkg/smithy-csharp.${{ env.VERSION }}.nupkg
66
+ asset_name : smithy-csharp.${{ env.VERSION }}.nupkg
67
+ asset_content_type : application/octet-stream
51
68
env :
52
69
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
70
with :
0 commit comments