77 draft_release :
88 name : Create draft release
99 runs-on : ubuntu-latest
10+ permissions :
11+ contents : write
12+ outputs :
13+ release_version : ${{ steps.tag_name.outputs.release_version }}
1014 steps :
1115 - name : Get version from tag
1216 id : tag_name
13- run : echo "RELEASE_VERSION =$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_ENV
17+ run : echo "release_version =$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_OUTPUT
1418 - uses : actions/checkout@v2
1519 - name : Create draft release
16- run : gh release create --draft "$tag" --title "$tag" --notes "${{ steps.changelog_reader.outputs.changes }}"
20+ env :
21+ GH_TOKEN : ${{ github.token }}
22+ GH_REPO : ${{ github.repository }}
23+ run : gh release create --draft "${{ steps.tag_name.outputs.release_version }}" --generate-notes
1724 - name : Upload universalJavaApplicationStub.sh asset
1825 env :
1926 GH_TOKEN : ${{ github.token }}
2027 GH_REPO : ${{ github.repository }}
21- run :
28+ run : |
2229 cp ./src/universalJavaApplicationStub ./universalJavaApplicationStub.sh
23- gh release upload ${{ env.RELEASE_VERSION }} ./universalJavaApplicationStub.sh
30+ gh release upload " ${{ steps.tag_name.outputs.release_version }}" ./universalJavaApplicationStub.sh
2431
2532 compile :
2633 name : Compile the stub
2734 needs : draft_release # we need to know the upload URL
2835 runs-on : macos-latest
36+ permissions :
37+ contents : write
2938 steps :
3039 - uses : actions/checkout@v2
3140
@@ -66,11 +75,11 @@ jobs:
6675 env :
6776 GH_TOKEN : ${{ github.token }}
6877 GH_REPO : ${{ github.repository }}
69- run :
78+ run : |
7079 cp build/x86_64/nativeJavaApplicationStub ./nativeJavaApplicationStub.x86_64
7180 cp build/arm64/nativeJavaApplicationStub ./nativeJavaApplicationStub.arm64
7281 cp build/universal/nativeJavaApplicationStub ./nativeJavaApplicationStub
73- gh release upload ${{ needs.draft_release.outputs.tag }} \
82+ gh release upload " ${{ needs.draft_release.outputs.release_version }}" \
7483 ./universalJavaApplicationStub.x86_64 \
7584 ./universalJavaApplicationStub.arm64 \
7685 ./universalJavaApplicationStub \
8291 name : Publish drafted release
8392 needs : [ draft_release, compile ]
8493 runs-on : ubuntu-latest
94+ permissions :
95+ contents : write
8596 steps :
8697 - name : Publish Release
8798 env :
8899 GH_TOKEN : ${{ github.token }}
89100 GH_REPO : ${{ github.repository }}
90- run : gh release edit ${{ needs.draft_release.outputs.tag }}
101+ run : gh release edit " ${{ needs.draft_release.outputs.release_version }}" --draft=false
0 commit comments