|
5 | 5 | make: |
6 | 6 | strategy: |
7 | 7 | matrix: |
8 | | - node-version: [18.x] |
| 8 | + node-version: [20.x] |
9 | 9 | os: [ubuntu-latest] |
10 | 10 | runs-on: ${{ matrix.os }} |
11 | 11 | steps: |
|
20 | 20 | run: npm install --global @vercel/ncc |
21 | 21 |
|
22 | 22 | - name: Install pkg |
23 | | - run: npm install --global pkg |
| 23 | + run: npm install -g @yao-pkg/pkg |
24 | 24 |
|
25 | 25 | - name: Create bin/ |
26 | 26 | run: mkdir bin |
|
51 | 51 | with: |
52 | 52 | name: Swarm-CLI-Windows.exe |
53 | 53 | 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