-
Notifications
You must be signed in to change notification settings - Fork 45
68 lines (57 loc) · 1.72 KB
/
publish.yml
File metadata and controls
68 lines (57 loc) · 1.72 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
name: Publish Package to npmjs
on:
release:
types: [published]
permissions:
id-token: write
contents: read
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup binfmt with QEMU
run: |
sudo apt update
sudo apt install qemu-system binfmt-support qemu-user-static
update-binfmts --display
- name: Setup ldid
run: |
git clone https://github.com/tpoechtrager/ldid
cd ./ldid
sudo make
sudo make install
- name: Install dependencies and build for Linux and Windows
run: |
bun install
bun run linux-x64
bun run linux-arm64
bun run mac-x64
bun run mac-arm64
bun run windows-x64
bun run windows-arm64
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Update npm to latest version for OIDC support
run: npm install -g npm@latest
- name: Determine release tag
id: release_tag
run: |
if [[ "${{ github.ref }}" == *"-rc"* ]] || [[ "${{ github.ref }}" == *"-RC"* ]]; then
echo "tag=next" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish
run: npm publish --provenance --access public --tag ${{ steps.release_tag.outputs.tag }}
- uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: build/
GHR_REPLACE: false
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}