|
12 | 12 | default: false
|
13 | 13 | type: boolean
|
14 | 14 |
|
15 |
| -env: |
16 |
| - GIT_TAG: ${{ github.event.inputs.tag }} |
17 |
| - |
18 | 15 | jobs:
|
19 | 16 | update-packagejson:
|
20 | 17 | uses: Cysharp/Actions/.github/workflows/update-packagejson.yaml@main
|
21 | 18 | with:
|
22 | 19 | file-path: ./src/DFrame.Unity/Assets/Plugins/DFrame/package.json
|
23 |
| - tag: ${{ github.event.inputs.tag }} |
24 |
| - dry-run: ${{ fromJson(github.event.inputs.dry-run) }} |
| 20 | + tag: ${{ inputs.tag }} |
| 21 | + dry-run: ${{ inputs.dry-run }} |
| 22 | + push-tag: false |
25 | 23 |
|
26 | 24 | build-dotnet:
|
27 | 25 | needs: [update-packagejson]
|
|
34 | 32 | ref: ${{ needs.update-packagejson.outputs.sha }}
|
35 | 33 | - uses: Cysharp/Actions/.github/actions/setup-dotnet@main
|
36 | 34 | # pack nuget
|
37 |
| - - run: dotnet build -c Release -p:Version=${{ env.GIT_TAG }} |
| 35 | + - run: dotnet build -c Release -p:Version=${{ inputs.tag }} |
38 | 36 | # - run: dotnet test -c Release --no-build
|
39 |
| - - run: dotnet pack -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish |
| 37 | + - run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish |
40 | 38 | - uses: actions/upload-artifact@v2
|
41 | 39 | with:
|
42 | 40 | name: nuget
|
@@ -76,41 +74,24 @@ jobs:
|
76 | 74 | # Store artifacts.
|
77 | 75 | - uses: actions/upload-artifact@v2
|
78 | 76 | with:
|
79 |
| - name: DFrame.Unity.${{ env.GIT_TAG }}.unitypackage |
| 77 | + name: DFrame.${{ inputs.tag }}.unitypackage |
80 | 78 | path: ./src/DFrame.Unity/*.unitypackage
|
81 | 79 |
|
| 80 | + # release |
82 | 81 | create-release:
|
83 |
| - if: github.event.inputs.dry-run == 'false' |
84 | 82 | needs: [update-packagejson, build-dotnet, build-unity]
|
85 |
| - runs-on: ubuntu-latest |
86 |
| - timeout-minutes: 10 |
87 |
| - steps: |
88 |
| - - uses: Cysharp/Actions/.github/actions/setup-dotnet@main |
89 |
| - # Create Releases |
90 |
| - - uses: actions/create-release@v1 |
91 |
| - id: create_release |
92 |
| - env: |
93 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
94 |
| - with: |
95 |
| - tag_name: ${{ env.GIT_TAG }} |
96 |
| - release_name: Ver.${{ env.GIT_TAG }} |
97 |
| - draft: true |
98 |
| - prerelease: false |
99 |
| - - uses: actions/download-artifact@v2 |
100 |
| - # Upload to NuGet |
101 |
| - - run: dotnet nuget push "./nuget/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }} |
102 |
| - # Upload to Releases(unitypackage) |
103 |
| - - uses: actions/upload-release-asset@v1 |
104 |
| - env: |
105 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
106 |
| - with: |
107 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
108 |
| - asset_path: ./DFrame.Unity.${{ env.GIT_TAG }}.unitypackage/DFrame.${{ env.GIT_TAG }}.unitypackage |
109 |
| - asset_name: DFrame.${{ env.GIT_TAG }}.unitypackage |
110 |
| - asset_content_type: application/octet-stream |
| 83 | + uses: Cysharp/Actions/.github/workflows/create-release.yaml@main |
| 84 | + with: |
| 85 | + commit-id: ${{ needs.update-packagejson.outputs.sha }} |
| 86 | + dry-run: ${{ inputs.dry-run }} |
| 87 | + tag: ${{ inputs.tag }} |
| 88 | + nuget-push: true |
| 89 | + release-upload: true |
| 90 | + release-asset-path: ./DFrame.${{ inputs.tag }}.unitypackage/DFrame.${{ inputs.tag }}.unitypackage |
| 91 | + secrets: inherit |
111 | 92 |
|
112 | 93 | cleanup:
|
113 |
| - if: needs.update-packagejson.outputs.is-branch-created == 'true' |
| 94 | + if: ${{ needs.update-packagejson.outputs.is-branch-created == 'true' }} |
114 | 95 | needs: [update-packagejson, build-dotnet, build-unity]
|
115 | 96 | uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main
|
116 | 97 | with:
|
|
0 commit comments