Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 43 additions & 2 deletions .github/workflows/make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
make:
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -20,7 +20,7 @@ jobs:
run: npm install --global @vercel/ncc

- name: Install pkg
run: npm install --global pkg
run: npm install -g @yao-pkg/pkg

- name: Create bin/
run: mkdir bin
Expand Down Expand Up @@ -51,3 +51,44 @@ jobs:
with:
name: Swarm-CLI-Windows.exe
path: Swarm-CLI-Windows.exe

- name: Get latest release
id: latest_release
uses: actions/github-script@v6
with:
script: |
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
core.setOutput("upload_url", releases[0].upload_url);

- name: Upload Linux binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.latest_release.outputs.upload_url }}
asset_path: Swarm-CLI-Linux
asset_name: Swarm-CLI-Linux
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}

- name: Upload MacOS binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.latest_release.outputs.upload_url }}
asset_path: Swarm-CLI-MacOS
asset_name: Swarm-CLI-MacOS
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}

- name: Upload Windows binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.latest_release.outputs.upload_url }}
asset_path: Swarm-CLI-Windows.exe
asset_name: Swarm-CLI-Windows.exe
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GHA_PAT_BASIC }}
Loading