|
3 | 3 | workflow_dispatch: |
4 | 4 |
|
5 | 5 | jobs: |
6 | | - # build: |
7 | | - # strategy: |
8 | | - # fail-fast: false |
9 | | - # matrix: |
10 | | - # include: |
11 | | - # # Windows |
12 | | - # - os: windows-latest |
13 | | - # target: x86_64-pc-windows-msvc |
14 | | - # # Mac OS |
15 | | - # - os: macos-latest |
16 | | - # target: x86_64-apple-darwin |
17 | | - # strip: strip -x # Must use -x on macOS. This produces larger results on linux. |
| 6 | + build: |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + include: |
| 11 | + # Windows |
| 12 | + - os: windows-latest |
| 13 | + target: x86_64-pc-windows-msvc |
| 14 | + # Mac OS |
| 15 | + - os: macos-latest |
| 16 | + target: x86_64-apple-darwin |
| 17 | + strip: strip -x # Must use -x on macOS. This produces larger results on linux. |
18 | 18 |
|
19 | | - # name: build-${{ matrix.target }} |
20 | | - # runs-on: ${{ matrix.os }} |
21 | | - # steps: |
22 | | - # - uses: actions/checkout@v2 |
23 | | - # - name: Install Node.JS |
24 | | - # uses: actions/setup-node@v2 |
25 | | - # with: |
26 | | - # node-version: 14 |
27 | | - # - name: Install Rust |
28 | | - # uses: actions-rs/toolchain@v1 |
29 | | - # with: |
30 | | - # toolchain: stable |
31 | | - # profile: minimal |
32 | | - # override: true |
| 19 | + name: build-${{ matrix.target }} |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Install Node.JS |
| 24 | + uses: actions/setup-node@v2 |
| 25 | + with: |
| 26 | + node-version: 14 |
| 27 | + - name: Install Rust |
| 28 | + uses: actions-rs/toolchain@v1 |
| 29 | + with: |
| 30 | + toolchain: stable |
| 31 | + profile: minimal |
| 32 | + override: true |
33 | 33 |
|
34 | | - # - name: Setup rust target |
35 | | - # run: rustup target add ${{ matrix.target }} |
| 34 | + - name: Setup rust target |
| 35 | + run: rustup target add ${{ matrix.target }} |
36 | 36 |
|
37 | | - # - uses: bahmutov/npm-install@v1.1.0 |
38 | | - # - name: Build release |
39 | | - # run: yarn build-release |
40 | | - # env: |
41 | | - # RUST_TARGET: ${{ matrix.target }} |
42 | | - # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
43 | | - # if: ${{ matrix.strip }} |
44 | | - # run: ${{ matrix.strip }} *.node |
45 | | - # - name: Upload artifacts |
46 | | - # uses: actions/upload-artifact@v2 |
47 | | - # with: |
48 | | - # name: bindings-${{ matrix.target }} |
49 | | - # path: '*.node' |
| 37 | + - uses: bahmutov/npm-install@v1.1.0 |
| 38 | + - name: Build release |
| 39 | + run: yarn build-release |
| 40 | + env: |
| 41 | + RUST_TARGET: ${{ matrix.target }} |
| 42 | + - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
| 43 | + if: ${{ matrix.strip }} |
| 44 | + run: ${{ matrix.strip }} *.node |
| 45 | + - name: Upload artifacts |
| 46 | + uses: actions/upload-artifact@v2 |
| 47 | + with: |
| 48 | + name: bindings-${{ matrix.target }} |
| 49 | + path: '*.node' |
50 | 50 |
|
51 | | - # build-apple-silicon: |
52 | | - # name: build-apple-silicon |
53 | | - # runs-on: macos-latest |
54 | | - # steps: |
55 | | - # - uses: actions/checkout@v2 |
56 | | - # - name: Install Node.JS |
57 | | - # uses: actions/setup-node@v2 |
58 | | - # with: |
59 | | - # node-version: 14 |
60 | | - # - name: Install Rust |
61 | | - # uses: actions-rs/toolchain@v1 |
62 | | - # with: |
63 | | - # toolchain: stable |
64 | | - # profile: minimal |
65 | | - # override: true |
| 51 | + build-apple-silicon: |
| 52 | + name: build-apple-silicon |
| 53 | + runs-on: macos-latest |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v2 |
| 56 | + - name: Install Node.JS |
| 57 | + uses: actions/setup-node@v2 |
| 58 | + with: |
| 59 | + node-version: 14 |
| 60 | + - name: Install Rust |
| 61 | + uses: actions-rs/toolchain@v1 |
| 62 | + with: |
| 63 | + toolchain: stable |
| 64 | + profile: minimal |
| 65 | + override: true |
66 | 66 |
|
67 | | - # - name: Setup rust target |
68 | | - # run: rustup target add aarch64-apple-darwin |
| 67 | + - name: Setup rust target |
| 68 | + run: rustup target add aarch64-apple-darwin |
69 | 69 |
|
70 | | - # - uses: bahmutov/npm-install@v1.1.0 |
71 | | - # - name: Build release |
72 | | - # run: yarn build-release |
73 | | - # env: |
74 | | - # RUST_TARGET: aarch64-apple-darwin |
75 | | - # JEMALLOC_SYS_WITH_LG_PAGE: 14 |
76 | | - # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
77 | | - # run: strip -x *.node |
78 | | - # - name: Upload artifacts |
79 | | - # uses: actions/upload-artifact@v2 |
80 | | - # with: |
81 | | - # name: bindings-aarch64-apple-darwin |
82 | | - # path: '*.node' |
| 70 | + - uses: bahmutov/npm-install@v1.1.0 |
| 71 | + - name: Build release |
| 72 | + run: yarn build-release |
| 73 | + env: |
| 74 | + RUST_TARGET: aarch64-apple-darwin |
| 75 | + JEMALLOC_SYS_WITH_LG_PAGE: 14 |
| 76 | + - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
| 77 | + run: strip -x *.node |
| 78 | + - name: Upload artifacts |
| 79 | + uses: actions/upload-artifact@v2 |
| 80 | + with: |
| 81 | + name: bindings-aarch64-apple-darwin |
| 82 | + path: '*.node' |
83 | 83 |
|
84 | | - # build-linux: |
85 | | - # strategy: |
86 | | - # fail-fast: false |
87 | | - # matrix: |
88 | | - # include: |
89 | | - # - target: x86_64-unknown-linux-gnu |
90 | | - # strip: strip |
91 | | - # image: docker.io/centos/nodejs-12-centos7 |
92 | | - # setup: npm install --global yarn@1 |
93 | | - # - target: aarch64-unknown-linux-gnu |
94 | | - # strip: aarch64-linux-gnu-strip |
95 | | - # image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian |
96 | | - # - target: armv7-unknown-linux-gnueabihf |
97 | | - # strip: arm-linux-gnueabihf-strip |
98 | | - # image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian |
99 | | - # setup: apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y |
100 | | - # - target: aarch64-unknown-linux-musl |
101 | | - # image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
102 | | - # strip: aarch64-linux-musl-strip |
103 | | - # - target: x86_64-unknown-linux-musl |
104 | | - # image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
105 | | - # strip: strip |
| 84 | + build-linux: |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + include: |
| 89 | + - target: x86_64-unknown-linux-gnu |
| 90 | + strip: strip |
| 91 | + image: docker.io/centos/nodejs-12-centos7 |
| 92 | + setup: npm install --global yarn@1 |
| 93 | + - target: aarch64-unknown-linux-gnu |
| 94 | + strip: aarch64-linux-gnu-strip |
| 95 | + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian |
| 96 | + - target: armv7-unknown-linux-gnueabihf |
| 97 | + strip: arm-linux-gnueabihf-strip |
| 98 | + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian |
| 99 | + setup: apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y |
| 100 | + - target: aarch64-unknown-linux-musl |
| 101 | + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
| 102 | + strip: aarch64-linux-musl-strip |
| 103 | + - target: x86_64-unknown-linux-musl |
| 104 | + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
| 105 | + strip: strip |
106 | 106 |
|
107 | | - # name: build-${{ matrix.target }} |
108 | | - # runs-on: ubuntu-latest |
109 | | - # container: |
110 | | - # image: ${{ matrix.image }} |
| 107 | + name: build-${{ matrix.target }} |
| 108 | + runs-on: ubuntu-latest |
| 109 | + container: |
| 110 | + image: ${{ matrix.image }} |
111 | 111 |
|
112 | | - # steps: |
113 | | - # - uses: actions/checkout@v2 |
114 | | - # - name: Install Node.JS |
115 | | - # uses: actions/setup-node@v2 |
116 | | - # with: |
117 | | - # node-version: 14 |
118 | | - # - name: Install Rust |
119 | | - # uses: actions-rs/toolchain@v1 |
120 | | - # with: |
121 | | - # toolchain: stable |
122 | | - # profile: minimal |
123 | | - # override: true |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v2 |
| 114 | + - name: Install Node.JS |
| 115 | + uses: actions/setup-node@v2 |
| 116 | + with: |
| 117 | + node-version: 14 |
| 118 | + - name: Install Rust |
| 119 | + uses: actions-rs/toolchain@v1 |
| 120 | + with: |
| 121 | + toolchain: stable |
| 122 | + profile: minimal |
| 123 | + override: true |
124 | 124 |
|
125 | | - # - name: Setup cross compile toolchain |
126 | | - # if: ${{ matrix.setup }} |
127 | | - # run: ${{ matrix.setup }} |
| 125 | + - name: Setup cross compile toolchain |
| 126 | + if: ${{ matrix.setup }} |
| 127 | + run: ${{ matrix.setup }} |
128 | 128 |
|
129 | | - # - name: Setup rust target |
130 | | - # run: rustup target add ${{ matrix.target }} |
| 129 | + - name: Setup rust target |
| 130 | + run: rustup target add ${{ matrix.target }} |
131 | 131 |
|
132 | | - # - uses: bahmutov/npm-install@v1.1.0 |
133 | | - # - name: Build release |
134 | | - # run: yarn build-release |
135 | | - # env: |
136 | | - # RUST_TARGET: ${{ matrix.target }} |
137 | | - # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
138 | | - # if: ${{ matrix.strip }} |
139 | | - # run: ${{ matrix.strip }} *.node |
140 | | - # - name: Upload artifacts |
141 | | - # uses: actions/upload-artifact@v2 |
142 | | - # with: |
143 | | - # name: bindings-${{ matrix.target }} |
144 | | - # path: '*.node' |
| 132 | + - uses: bahmutov/npm-install@v1.1.0 |
| 133 | + - name: Build release |
| 134 | + run: yarn build-release |
| 135 | + env: |
| 136 | + RUST_TARGET: ${{ matrix.target }} |
| 137 | + - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 |
| 138 | + if: ${{ matrix.strip }} |
| 139 | + run: ${{ matrix.strip }} *.node |
| 140 | + - name: Upload artifacts |
| 141 | + uses: actions/upload-artifact@v2 |
| 142 | + with: |
| 143 | + name: bindings-${{ matrix.target }} |
| 144 | + path: '*.node' |
145 | 145 |
|
146 | | - # release: |
147 | | - # runs-on: ubuntu-latest |
148 | | - # name: Build and release |
149 | | - # needs: |
150 | | - # - build |
151 | | - # - build-linux |
152 | | - # - build-apple-silicon |
153 | | - # steps: |
154 | | - # - uses: actions/checkout@v1 |
155 | | - # - uses: bahmutov/npm-install@v1.1.0 |
156 | | - # - name: Download artifacts |
157 | | - # uses: actions/download-artifact@v2 |
158 | | - # with: |
159 | | - # path: artifacts |
160 | | - # - name: Move artifacts |
161 | | - # run: cp artifacts/*/*.node . |
162 | | - # - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc |
163 | | - # env: |
164 | | - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
165 | | - # - run: npm publish |
| 146 | + release: |
| 147 | + runs-on: ubuntu-latest |
| 148 | + name: Build and release |
| 149 | + needs: |
| 150 | + - build |
| 151 | + - build-linux |
| 152 | + - build-apple-silicon |
| 153 | + steps: |
| 154 | + - uses: actions/checkout@v1 |
| 155 | + - uses: bahmutov/npm-install@v1.1.0 |
| 156 | + - name: Download artifacts |
| 157 | + uses: actions/download-artifact@v2 |
| 158 | + with: |
| 159 | + path: artifacts |
| 160 | + - name: Move artifacts |
| 161 | + run: cp artifacts/*/*.node . |
| 162 | + - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc |
| 163 | + env: |
| 164 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 165 | + - run: npm publish |
166 | 166 |
|
167 | 167 | release-crates: |
168 | 168 | runs-on: ubuntu-latest |
|
0 commit comments