-
Notifications
You must be signed in to change notification settings - Fork 6
108 lines (104 loc) · 3.3 KB
/
publish.yaml
File metadata and controls
108 lines (104 loc) · 3.3 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Creates and publishes assets for a new release.
name: Publish
on:
release:
types:
- created # triggered by Bump Version creating a release
workflow_dispatch:
jobs:
publish-github:
runs-on: ${{ matrix.system.os }}
strategy:
fail-fast: false
matrix:
node_version:
- 20
- 22
- 24
system:
- os: macos-15-intel
target: x86_64-apple-darwin
arch: x64
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
arch: x64
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
arch: arm64
- os: windows-2025
target: x86_64-pc-windows-msvc
arch: x64
- os: macos-14
target: aarch64-apple-darwin
arch: arm64
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}${{ github.event.inputs.name }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.system.arch }}
cache: yarn
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.system.target }}
override: true
- name: Install modules
run: yarn install --ignore-scripts
- name: Build
id: build
# Use bash, even on Windows.
shell: bash
env:
PRE_GYP_PLATFORM: ${{ matrix.system.pre_gyp_platform }}
PRE_GYP_ARCH: ${{ matrix.system.pre_gyp_arch }}
CARGO_BUILD_TARGET: ${{ matrix.system.target }}
run: |
node build.js
cd bin-package
echo "asset=$(echo *.tar.gz)" >> "$GITHUB_OUTPUT"
- name: Upload release asset
run: gh release upload ${{ github.event.release.tag_name }}${{ github.event.inputs.name }} bin-package/${{ steps.build.outputs.asset }} --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Release musl binaries
publish-github-docker:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# These Node versions should match those above in the `publish-github` job.
node_version:
- 20
- 22
- 24
os:
- ubuntu-24.04
- ubuntu-24.04-arm
fail-fast: false
steps:
- uses: actions/checkout@v5
- name: Build
run: docker build --build-arg NODE_VERSION=${{matrix.node_version}} --output type=local,dest=./host-artifacts .
- name: Output
id: asset
run: |
cd host-artifacts/out
echo "asset=$(echo *.tar.gz)" >> "$GITHUB_OUTPUT"
- name: Upload release asset
run: |
git config --global --add safe.directory $(pwd)
gh release upload ${{ github.event.release.tag_name }}${{ github.event.inputs.name }} host-artifacts/out/${{ steps.asset.outputs.asset }} --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs:
- publish-github
- publish-github-docker
uses: IronCoreLabs/workflows/.github/workflows/typescript-release.yaml@typescript-release-v1
with:
pre_publish_steps: "./build.js"
publish_working_directory: "dist"
secrets: inherit