-
Notifications
You must be signed in to change notification settings - Fork 24
94 lines (78 loc) · 2.57 KB
/
make.yaml
File metadata and controls
94 lines (78 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Make binary
on: [workflow_dispatch]
jobs:
make:
strategy:
matrix:
node-version: [20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install deps
run: npm ci
- name: Install ncc
run: npm install --global @vercel/ncc
- name: Install pkg
run: npm install -g @yao-pkg/pkg
- name: Create bin/
run: mkdir bin
- name: Run ncc
run: ncc build src/index.ts -o bin
- name: Run pkg
run: pkg bin/index.js
- name: Rename binaries
run: |
mv index-linux Swarm-CLI-Linux
mv index-macos Swarm-CLI-MacOS
mv index-win.exe Swarm-CLI-Windows.exe
- uses: actions/upload-artifact@v4
with:
name: Swarm-CLI-Linux
path: Swarm-CLI-Linux
- uses: actions/upload-artifact@v4
with:
name: Swarm-CLI-MacOS
path: Swarm-CLI-MacOS
- uses: actions/upload-artifact@v4
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 }}