Skip to content

Commit efc6a22

Browse files
authored
Merge pull request #19 from tmax-cloud/upload-release-asset
Fix workflow to upload binary when release is published
2 parents 91c29a1 + 09061f5 commit efc6a22

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/hcsctl.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ on:
33
push:
44
branches:
55
- master
6-
tags:
7-
- v*
86
pull_request:
7+
release:
8+
types:
9+
- published
910
defaults:
1011
run:
1112
working-directory: hcsctl
@@ -57,18 +58,26 @@ jobs:
5758
build/hcsctl uninstall ../hack/inventory/test-sample
5859
build/hcsctl uninstall ../hack/inventory/test-sample # idempotent
5960
../hack/prolinux_cluster.sh down
60-
release:
61-
if: startsWith(github.ref, 'refs/tags/v')
61+
deploy:
62+
if: github.event_name == 'release'
6263
needs: [lint, build, e2e]
6364
runs-on: prolinux
6465
steps:
6566
- name: Upload hcsctl binary
66-
uses: actions/upload-artifact@v1
67+
uses: actions/upload-release-asset@v1
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6770
with:
68-
name: hcsctl
69-
path: hcsctl/build/
71+
upload_url: ${{ github.event.release.upload_url }}
72+
asset_path: hcsctl/build/
73+
asset_name: hcsctl
74+
asset_content_type: application/octet-stream
7075
- name: Upload hcsctl.test binary
71-
uses: actions/upload-artifact@v1
76+
uses: actions/upload-release-asset@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7279
with:
73-
name: hcsctl.test
74-
path: hcsctl/build/
80+
upload_url: ${{ github.event.release.upload_url }}
81+
asset_path: hcsctl/build/
82+
asset_name: hcsctl.test
83+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)