Skip to content

Commit 5ddabe6

Browse files
committed
update in github workflow
1 parent 01d5675 commit 5ddabe6

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

.github/workflows/releasebuild.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
language: [ 'go' ]
17+
permissions:
18+
# required for all workflows
19+
security-events: read
20+
actions: write
21+
contents: write
1722

1823
steps:
1924
- name: Checkout repository
@@ -28,36 +33,37 @@ jobs:
2833
run: |
2934
bash scripts/build-all-arch.sh
3035
working-directory: "."
31-
if: steps.build.outputs.exit_code == 0
3236

3337
- name: "Test"
38+
id: "test"
3439
# only testing amd64 and 386 builds, as the github machine do not support others
3540
run: |
3641
set -e
3742
sudo apt-get install -y buildah
3843
for exe in devc-v*amd64 devc-v*386 ; do echo -e "\nTesting $exe"; if ! ./$exe --version ; then echo "Error executing : $exe" ; exit 1; fi; done ;
3944
working-directory: "."
40-
if: steps.build.outputs.exit_code == 0
4145

4246
- name: Create Release
4347
id: create_release
4448
uses: actions/create-release@v1
4549
env:
4650
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4751
with:
48-
tag_name: ${{ github.ref }}
49-
release_name: ${{ github.ref }}
52+
tag_name: ${{ github.ref_name }}
53+
release_name: ${{ github.ref_name }}
5054
draft: false
5155
prerelease: false
56+
if: steps.test.outputs.exit_code == 0
57+
5258
- name: Upload Release Asset 386
5359
id: upload-release-asset-386
5460
uses: actions/upload-release-asset@v1
5561
env:
5662
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5763
with:
5864
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
59-
asset_path: ./devc-v*-386
60-
asset_name: devc-linux-386
65+
asset_path: ./devc-${{ github.ref_name }}-linux-386
66+
asset_name: devc-${{ github.ref_name }}-linux-386
6167
asset_content_type: binary/octet-stream
6268

6369
- name: Upload Release Asset amd64
@@ -67,28 +73,32 @@ jobs:
6773
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6874
with:
6975
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
70-
asset_path: ./devc-v*-amd64
71-
asset_name: devc-linux-amd64
76+
asset_path: ./devc-${{ github.ref_name }}-linux-amd64
77+
asset_name: devc-${{ github.ref_name }}-amd64
7278
asset_content_type: binary/octet-stream
7379

7480
- name: Upload Release Asset arm
7581
id: upload-release-asset-arm
7682
uses: actions/upload-release-asset@v1
7783
env:
84+
GH_TOKEN: ${{ github.token }}
85+
GH_REPO: ${{ github.repository }}
7886
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7987
with:
8088
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
81-
asset_path: ./devc-v*-arm
82-
asset_name: devc-linux-arm
89+
asset_path: ./devc-${{ github.ref_name }}-linux-arm
90+
asset_name: devc-${{ github.ref_name }}-arm
8391
asset_content_type: binary/octet-stream
8492

8593
- name: Upload Release Asset arm64
8694
id: upload-release-asset-arm64
8795
uses: actions/upload-release-asset@v1
8896
env:
97+
GH_TOKEN: ${{ github.token }}
98+
GH_REPO: ${{ github.repository }}
8999
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90100
with:
91101
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
92-
asset_path: ./devc-v*-arm64
93-
asset_name: devc-linux-arm64
102+
asset_path: ./devc-${{ github.ref_name }}-linux-arm64
103+
asset_name: devc-${{ github.ref_name }}-arm64
94104
asset_content_type: binary/octet-stream

0 commit comments

Comments
 (0)