Skip to content

Commit bb4c4ae

Browse files
authored
ci: upload binary release assets (#572)
* ci: upload binary release assets * ci: use yao-pkg
1 parent d1b92d6 commit bb4c4ae

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

.github/workflows/make.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
make:
66
strategy:
77
matrix:
8-
node-version: [18.x]
8+
node-version: [20.x]
99
os: [ubuntu-latest]
1010
runs-on: ${{ matrix.os }}
1111
steps:
@@ -20,7 +20,7 @@ jobs:
2020
run: npm install --global @vercel/ncc
2121

2222
- name: Install pkg
23-
run: npm install --global pkg
23+
run: npm install -g @yao-pkg/pkg
2424

2525
- name: Create bin/
2626
run: mkdir bin
@@ -51,3 +51,44 @@ jobs:
5151
with:
5252
name: Swarm-CLI-Windows.exe
5353
path: Swarm-CLI-Windows.exe
54+
55+
- name: Get latest release
56+
id: latest_release
57+
uses: actions/github-script@v6
58+
with:
59+
script: |
60+
const { data: releases } = await github.rest.repos.listReleases({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo
63+
});
64+
core.setOutput("upload_url", releases[0].upload_url);
65+
66+
- name: Upload Linux binary
67+
uses: actions/upload-release-asset@v1
68+
with:
69+
upload_url: ${{ steps.latest_release.outputs.upload_url }}
70+
asset_path: Swarm-CLI-Linux
71+
asset_name: Swarm-CLI-Linux
72+
asset_content_type: application/octet-stream
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}
75+
76+
- name: Upload MacOS binary
77+
uses: actions/upload-release-asset@v1
78+
with:
79+
upload_url: ${{ steps.latest_release.outputs.upload_url }}
80+
asset_path: Swarm-CLI-MacOS
81+
asset_name: Swarm-CLI-MacOS
82+
asset_content_type: application/octet-stream
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}
85+
86+
- name: Upload Windows binary
87+
uses: actions/upload-release-asset@v1
88+
with:
89+
upload_url: ${{ steps.latest_release.outputs.upload_url }}
90+
asset_path: Swarm-CLI-Windows.exe
91+
asset_name: Swarm-CLI-Windows.exe
92+
asset_content_type: application/octet-stream
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}

0 commit comments

Comments
 (0)