@@ -4,38 +4,23 @@ name: Compile and release
44on : workflow_dispatch
55
66jobs :
7-
87 draft_release :
98 name : Create draft release
109 runs-on : ubuntu-latest
11- outputs :
12- release_id : ${{ steps.create_draft_release.outputs.id }}
13- upload_url : ${{ steps.create_draft_release.outputs.upload_url }}
1410 steps :
1511 - name : Get version from tag
1612 id : tag_name
1713 run : echo "RELEASE_VERSION=$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_ENV
1814 - uses : actions/checkout@v2
1915 - name : Create draft release
20- id : create_draft_release
21- uses : actions/create-release@v1
22- env :
23- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24- with :
25- tag_name : ${{ env.RELEASE_VERSION }}
26- release_name : ${{ env.RELEASE_VERSION }}
27- draft : true
28- prerelease : ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
29- body : ${{ steps.changelog_reader.outputs.changes }}
16+ run : gh release create --draft "$tag" --title "$tag" --notes "${{ steps.changelog_reader.outputs.changes }}"
3017 - name : Upload universalJavaApplicationStub.sh asset
31- uses : actions/upload-release-asset@v1
3218 env :
33- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34- with :
35- upload_url : ${{ steps.create_draft_release.outputs.upload_url }}
36- asset_name : universalJavaApplicationStub.sh
37- asset_path : ./src/universalJavaApplicationStub
38- asset_content_type : text/x-shellscript
19+ GH_TOKEN : ${{ github.token }}
20+ GH_REPO : ${{ github.repository }}
21+ run :
22+ cp ./src/universalJavaApplicationStub ./universalJavaApplicationStub.sh
23+ gh release upload ${{ env.RELEASE_VERSION }} ./universalJavaApplicationStub.sh
3924
4025 compile :
4126 name : Compile the stub
@@ -77,73 +62,29 @@ jobs:
7762 run : |
7863 make universal
7964
80- - name : Upload universalJavaApplicationStub.x86_64 asset
81- uses : actions/upload-release-asset@v1
82- env :
83- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84- with :
85- upload_url : ${{ needs.draft_release.outputs.upload_url }}
86- asset_name : universalJavaApplicationStub.x86_64
87- asset_path : ./universalJavaApplicationStub.x86_64
88- asset_content_type : application/octet-stream
89-
90- - name : Upload universalJavaApplicationStub.arm64 asset
91- uses : actions/upload-release-asset@v1
92- env :
93- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94- with :
95- upload_url : ${{ needs.draft_release.outputs.upload_url }}
96- asset_name : universalJavaApplicationStub.arm64
97- asset_path : ./universalJavaApplicationStub.arm64
98- asset_content_type : application/octet-stream
99-
100- - name : Upload universalJavaApplicationStub asset
101- uses : actions/upload-release-asset@v1
102- env :
103- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104- with :
105- upload_url : ${{ needs.draft_release.outputs.upload_url }}
106- asset_name : universalJavaApplicationStub
107- asset_path : ./universalJavaApplicationStub
108- asset_content_type : application/octet-stream
109-
110- - name : Upload nativeJavaApplicationStub.x86_64 asset
111- uses : actions/upload-release-asset@v1
112- env :
113- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114- with :
115- upload_url : ${{ needs.draft_release.outputs.upload_url }}
116- asset_name : nativeJavaApplicationStub.x86_64
117- asset_path : ./build/x86_64/nativeJavaApplicationStub
118- asset_content_type : application/octet-stream
119-
120- - name : Upload nativeJavaApplicationStub.arm64 asset
121- uses : actions/upload-release-asset@v1
122- env :
123- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
124- with :
125- upload_url : ${{ needs.draft_release.outputs.upload_url }}
126- asset_name : nativeJavaApplicationStub.arm64
127- asset_path : ./build/arm64/nativeJavaApplicationStub
128- asset_content_type : application/octet-stream
129-
130- - name : Upload nativeJavaApplicationStub asset
131- uses : actions/upload-release-asset@v1
65+ - name : Upload compiled assets
13266 env :
133- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134- with :
135- upload_url : ${{ needs.draft_release.outputs.upload_url }}
136- asset_name : nativeJavaApplicationStub
137- asset_path : ./build/universal/nativeJavaApplicationStub
138- asset_content_type : application/octet-stream
67+ GH_TOKEN : ${{ github.token }}
68+ GH_REPO : ${{ github.repository }}
69+ run :
70+ cp build/x86_64/nativeJavaApplicationStub ./nativeJavaApplicationStub.x86_64
71+ cp build/arm64/nativeJavaApplicationStub ./nativeJavaApplicationStub.arm64
72+ cp build/universal/nativeJavaApplicationStub ./nativeJavaApplicationStub
73+ gh release upload ${{ needs.draft_release.outputs.tag }} \
74+ ./universalJavaApplicationStub.x86_64 \
75+ ./universalJavaApplicationStub.arm64 \
76+ ./universalJavaApplicationStub \
77+ ./nativeJavaApplicationStub.x86_64 \
78+ ./nativeJavaApplicationStub.arm64 \
79+ ./nativeJavaApplicationStub
13980
14081 publish_release :
14182 name : Publish drafted release
14283 needs : [ draft_release, compile ]
14384 runs-on : ubuntu-latest
14485 steps :
145- - uses : eregon/publish-release@v1
86+ - name : Publish Release
14687 env :
147- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
148- with :
149- release_id : ${{ needs.draft_release.outputs.release_id }}
88+ GH_TOKEN : ${{ github.token }}
89+ GH_REPO : ${{ github.repository }}
90+ run : gh release edit ${{ needs.draft_release.outputs.tag }}
0 commit comments