77 description : " tag: git tag you want create. (sample 1.0.0)"
88 required : true
99 dry-run :
10- description : " dry-run: false = create release/nuget. true = never create release/nuget."
10+ description : " dry-run: true will never create release/nuget."
1111 required : true
1212 default : false
1313 type : boolean
1414
15+ env :
16+ GIT_TAG : ${{ github.event.inputs.tag }}
17+ DRY_RUN : ${{ github.event.inputs.dry-run }}
18+
1519jobs :
1620 build-dotnet :
1721 runs-on : ubuntu-latest
@@ -23,21 +27,45 @@ jobs:
2327 dotnet-version : |
2428 7.0.x
2529 # pack nuget
26- - run : dotnet build -c Release -p:Version=${{ inputs.tag }}
30+ - run : dotnet build -c Release -p:Version=${{ env.GIT_TAG }}
2731 - run : dotnet test -c Release --no-build
28- - run : dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
29- - uses : actions/upload-artifact@v3
32+ - run : dotnet pack -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
33+ - uses : actions/upload-artifact@v2
3034 with :
3135 name : nuget
3236 path : ./publish
3337
34- # release
3538 create-release :
39+ if : ${{ github.event.inputs.dry-run == 'false' }}
3640 needs : [build-dotnet]
37- uses : Cysharp/Actions/.github/workflows/create-release.yaml@main
38- with :
39- dry-run : ${{ inputs.dry-run }}
40- tag : ${{ inputs.tag }}
41- push-tag : true
42- nuget-push : true
43- secrets : inherit
41+ runs-on : ubuntu-latest
42+ timeout-minutes : 10
43+ steps :
44+ # tag
45+ - uses : Cysharp/Actions/.github/actions/setup-dotnet@main
46+ with :
47+ dotnet-version : |
48+ 7.0.x
49+ - uses : actions/checkout@v3
50+ - name : tag
51+ run : git tag ${{ env.GIT_TAG }}
52+ - name : Push changes
53+ uses : ad-m/github-push-action@master
54+ with :
55+ github_token : ${{ secrets.GITHUB_TOKEN }}
56+ branch : ${{ github.ref }}
57+ tags : true
58+ # Create Releases
59+ - uses : actions/create-release@v1
60+ id : create_release
61+ env :
62+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63+ with :
64+ tag_name : ${{ env.GIT_TAG }}
65+ release_name : Ver.${{ env.GIT_TAG }}
66+ draft : true
67+ prerelease : false
68+ # Download (All) Artifacts to current directory
69+ - uses : actions/download-artifact@v2
70+ # Upload to NuGet
71+ - run : dotnet nuget push "./nuget/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}
0 commit comments