|
1 | 1 | name: tag-release
|
| 2 | + |
2 | 3 | on:
|
3 | 4 | release:
|
4 | 5 | types: [published]
|
5 | 6 | workflow_dispatch:
|
6 |
| -permissions: |
7 |
| - contents: read # for actions/checkout |
8 |
| -jobs: |
9 |
| - build: |
10 |
| - strategy: |
11 |
| - fail-fast: false |
12 |
| - matrix: |
13 |
| - os: [macos-latest, windows-latest] |
14 |
| - name: ${{ matrix.os }} |
15 |
| - runs-on: ${{ matrix.os }} |
16 |
| - steps: |
17 |
| - - uses: actions/checkout@v4 |
18 |
| - - name: Install Rust |
19 |
| - uses: dtolnay/rust-toolchain@master |
20 |
| - with: |
21 |
| - toolchain: stable |
22 |
| - - uses: bahmutov/[email protected] |
23 |
| - - name: Build native packages |
24 |
| - run: yarn build-native-release |
25 |
| - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
26 |
| - if: ${{ matrix.os == 'macos-latest' }} |
27 |
| - run: strip -x packages/*/*/*.node # Must use -x on macOS. This produces larger results on linux. |
28 |
| - - name: Upload artifacts |
29 |
| - uses: actions/upload-artifact@v3 |
30 |
| - with: |
31 |
| - name: bindings-${{ matrix.os }} |
32 |
| - path: packages/*/*/*.node |
33 |
| - - name: Smoke test |
34 |
| - run: node -e "require('@parcel/rust')" |
35 |
| - |
36 |
| - build-linux-gnu-x64: |
37 |
| - name: linux-gnu-x64 |
38 |
| - runs-on: ubuntu-20.04 |
39 |
| - container: |
40 |
| - image: docker.io/mischnic/centos7-node16 |
41 |
| - steps: |
42 |
| - - uses: actions/checkout@v3 |
43 |
| - - name: Install yarn |
44 |
| - run: npm install --global yarn@1 |
45 |
| - - name: Install Rust |
46 |
| - uses: actions-rs/toolchain@v1 |
47 |
| - with: |
48 |
| - toolchain: stable |
49 |
| - profile: minimal |
50 |
| - override: true |
51 |
| - - uses: bahmutov/[email protected] |
52 |
| - - name: Build native packages |
53 |
| - run: yarn build-native-release |
54 |
| - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
55 |
| - run: strip packages/*/*/*.node |
56 |
| - - name: Upload artifacts |
57 |
| - uses: actions/upload-artifact@v3 |
58 |
| - with: |
59 |
| - name: bindings-linux-gnu-x64 |
60 |
| - path: packages/*/*/*.node |
61 |
| - - name: debug |
62 |
| - run: ls -l packages/*/*/*.node |
63 |
| - - name: Smoke test |
64 |
| - run: node -e 'require("@parcel/rust")' |
65 |
| - |
66 |
| - build-linux-gnu-arm: |
67 |
| - strategy: |
68 |
| - fail-fast: false |
69 |
| - matrix: |
70 |
| - include: |
71 |
| - - target: arm-unknown-linux-gnueabihf |
72 |
| - arch: armhf |
73 |
| - strip: arm-linux-gnueabihf-strip |
74 |
| - cflags: -mfpu=neon |
75 |
| - - target: aarch64-unknown-linux-gnu |
76 |
| - arch: arm64 |
77 |
| - strip: aarch64-linux-gnu-strip |
78 |
| - cflags: '' |
79 |
| - name: ${{ matrix.target }} |
80 |
| - runs-on: ubuntu-20.04 |
81 |
| - steps: |
82 |
| - - uses: actions/checkout@v4 |
83 |
| - - name: Install Rust |
84 |
| - uses: dtolnay/rust-toolchain@master |
85 |
| - with: |
86 |
| - toolchain: stable |
87 |
| - target: ${{ matrix.target }} |
88 |
| - - name: Install cross compile toolchains |
89 |
| - run: | |
90 |
| - sudo apt-get update |
91 |
| - sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y |
92 |
| - - uses: bahmutov/[email protected] |
93 |
| - - name: Build native packages |
94 |
| - run: yarn build-native-release |
95 |
| - env: |
96 |
| - RUST_TARGET: ${{ matrix.target }} |
97 |
| - CFLAGS: ${{ matrix.cflags }} |
98 |
| - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
99 |
| - run: ${{ matrix.strip }} packages/*/*/*.node |
100 |
| - - name: Upload artifacts |
101 |
| - uses: actions/upload-artifact@v3 |
102 |
| - with: |
103 |
| - name: bindings-${{ matrix.target }} |
104 |
| - path: packages/*/*/*.node |
105 |
| - - name: debug |
106 |
| - run: ls -l packages/*/*/*.node |
107 |
| - - name: Configure binfmt-support |
108 |
| - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset |
109 |
| - - name: Smoke test |
110 |
| - uses: addnab/docker-run-action@v1 |
111 |
| - with: |
112 |
| - image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal |
113 |
| - options: -v ${{github.workspace}}:/work |
114 |
| - run: cd /work && node -e "require('@parcel/rust')" |
115 |
| - |
116 |
| - build-linux-musl: |
117 |
| - strategy: |
118 |
| - fail-fast: false |
119 |
| - matrix: |
120 |
| - include: |
121 |
| - - target: x86_64-unknown-linux-musl |
122 |
| - strip: strip |
123 |
| - cflags: -msse4.2 |
124 |
| - arch: x86_64 |
125 |
| - - target: aarch64-unknown-linux-musl |
126 |
| - strip: aarch64-linux-musl-strip |
127 |
| - cflags: '' |
128 |
| - arch: aarch64 |
129 |
| - name: ${{ matrix.target }} |
130 |
| - runs-on: ubuntu-20.04 |
131 |
| - container: |
132 |
| - image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:5a99e45446355d25c20e95d35231d84e9ce472280d8c0b1be53281bade905f09 |
133 |
| - credentials: |
134 |
| - username: ${{ github.actor }} |
135 |
| - password: ${{ secrets.GHCR_TOKEN }} |
136 |
| - steps: |
137 |
| - - uses: actions/checkout@v4 |
138 |
| - - name: Install build tools |
139 |
| - run: apk add --no-cache python3 make gcc g++ musl-dev curl |
140 |
| - - name: Install Rust |
141 |
| - uses: dtolnay/rust-toolchain@master |
142 |
| - with: |
143 |
| - toolchain: stable |
144 |
| - target: ${{ matrix.target }} |
145 |
| - - uses: bahmutov/[email protected] |
146 |
| - - name: Build native packages |
147 |
| - run: yarn build-native-release |
148 |
| - env: |
149 |
| - RUST_TARGET: ${{ matrix.target }} |
150 |
| - CFLAGS: ${{ matrix.cflags }} |
151 |
| - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
152 |
| - run: ${{ matrix.strip }} packages/*/*/*.node |
153 |
| - - name: Upload artifacts |
154 |
| - uses: actions/upload-artifact@v3 |
155 |
| - with: |
156 |
| - name: bindings-linux-musl-${{ matrix.arch }} |
157 |
| - path: packages/*/*/*.node |
158 |
| - - name: debug |
159 |
| - run: ls -l packages/*/*/*.node |
160 |
| - - name: Smoke test |
161 |
| - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} |
162 |
| - run: node -e 'require("@parcel/rust")' |
163 |
| - |
164 |
| - build-apple-silicon: |
165 |
| - name: aarch64-apple-darwin |
166 |
| - runs-on: macos-latest |
167 |
| - steps: |
168 |
| - - uses: actions/checkout@v4 |
169 |
| - - name: Install Rust |
170 |
| - uses: dtolnay/rust-toolchain@master |
171 |
| - with: |
172 |
| - toolchain: stable |
173 |
| - target: aarch64-apple-darwin |
174 |
| - - uses: bahmutov/[email protected] |
175 |
| - - name: Build native packages |
176 |
| - run: | |
177 |
| - sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; |
178 |
| - yarn build-native-release |
179 |
| - env: |
180 |
| - RUST_TARGET: aarch64-apple-darwin |
181 |
| - JEMALLOC_SYS_WITH_LG_PAGE: 14 |
182 |
| - - name: Strip debug symbols |
183 |
| - run: strip -x packages/*/*/*.node |
184 |
| - - name: Upload artifacts |
185 |
| - uses: actions/upload-artifact@v3 |
186 |
| - with: |
187 |
| - name: bindings-apple-aarch64 |
188 |
| - path: packages/*/*/*.node |
189 |
| - - name: debug |
190 |
| - run: ls -l packages/*/*/*.node |
191 | 7 |
|
| 8 | +jobs: |
192 | 9 | build-and-release:
|
193 |
| - runs-on: ubuntu-20.04 |
194 | 10 | name: Build and release the tagged version
|
195 |
| - needs: |
196 |
| - - build |
197 |
| - - build-linux-musl |
198 |
| - - build-linux-gnu-x64 |
199 |
| - - build-linux-gnu-arm |
200 |
| - - build-apple-silicon |
201 |
| - steps: |
202 |
| - - uses: actions/checkout@v4 |
203 |
| - with: |
204 |
| - fetch-depth: 0 |
205 |
| - - uses: bahmutov/[email protected] |
206 |
| - - name: Build native packages |
207 |
| - run: yarn build-native-release |
208 |
| - - name: Download artifacts |
209 |
| - uses: actions/download-artifact@v3 |
210 |
| - with: |
211 |
| - path: artifacts |
212 |
| - - name: Move artifacts |
213 |
| - run: for d in artifacts/*/*/*; do cp $d/*.node packages/$(basename $(dirname $d))/$(basename $d); done |
214 |
| - - name: Debug |
215 |
| - run: ls -l packages/*/*/*.node |
216 |
| - - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc |
217 |
| - env: |
218 |
| - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
219 |
| - - run: yarn release |
| 11 | + uses: ./.github/workflows/release.yml |
| 12 | + secrets: inherit |
| 13 | + with: |
| 14 | + release-command: yarn release |
| 15 | + type: latest |
220 | 16 |
|
221 | 17 | # Deployment steps taken from https://github.com/colinwilson/static-site-to-vercel/blob/master/.github/workflows/deploy-preview.yml
|
222 | 18 | repl_build:
|
223 | 19 | name: Build REPL
|
224 | 20 | runs-on: ubuntu-latest
|
225 | 21 | permissions:
|
| 22 | + contents: read |
226 | 23 | deployments: write
|
227 | 24 | steps:
|
228 | 25 | - uses: actions/checkout@v4
|
|
0 commit comments