Repository navigation
304 lines (262 loc) · 8.22 KB
/
Copy pathrelease.yml
File metadata and controls
304 lines (262 loc) · 8.22 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build-cli:
name: Build CLI - ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-latest
os: macos
archive: tar.gz
- target: aarch64-apple-darwin
runner: macos-latest
os: macos
archive: tar.gz
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
os: linux
archive: tar.gz
- target: aarch64-unknown-linux-gnu
runner: ubuntu-latest
os: linux
use_cross: true
archive: tar.gz
- target: x86_64-pc-windows-msvc
runner: windows-latest
os: windows
archive: zip
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross --locked
- name: Build CLI
run: |
if [ "${{ matrix.use_cross }}" = "true" ]; then
cross build -p inky-cli --release --target ${{ matrix.target }}
else
cargo build -p inky-cli --release --target ${{ matrix.target }}
fi
shell: bash
- name: Package (unix)
if: matrix.os != 'windows'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../inky-${{ matrix.target }}.tar.gz inky
shell: bash
- name: Package (windows)
if: matrix.os == 'windows'
run: |
cd target/${{ matrix.target }}/release
7z a ../../../inky-${{ matrix.target }}.zip inky.exe
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: cli-${{ matrix.target }}
path: inky-${{ matrix.target }}.${{ matrix.archive }}
build-ffi:
name: Build FFI - ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-latest
os: macos
lib_name: libinky.dylib
- target: aarch64-apple-darwin
runner: macos-latest
os: macos
lib_name: libinky.dylib
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
os: linux
lib_name: libinky.so
- target: aarch64-unknown-linux-gnu
runner: ubuntu-latest
os: linux
lib_name: libinky.so
use_cross: true
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross --locked
- name: Build FFI
run: |
if [ "${{ matrix.use_cross }}" = "true" ]; then
cross build -p inky-ffi --release --target ${{ matrix.target }}
else
cargo build -p inky-ffi --release --target ${{ matrix.target }}
fi
shell: bash
- name: Package
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../libinky-${{ matrix.target }}.tar.gz ${{ matrix.lib_name }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: ffi-${{ matrix.target }}
path: libinky-${{ matrix.target }}.tar.gz
build-wasm:
name: Build WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM
run: wasm-pack build crates/inky-wasm --target nodejs --out-dir ../../bindings/node
- name: Package
run: tar czf inky-nodejs.tar.gz -C bindings node
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: wasm-nodejs
path: inky-nodejs.tar.gz
release:
name: Create GitHub Release
needs: [build-cli, build-ffi, build-wasm]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Collect release assets
run: |
mkdir release
find artifacts -type f \( -name '*.tar.gz' -o -name '*.zip' \) -exec cp {} release/ \;
cd release
sha256sum * > SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
generate_release_notes: true
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-crates:
name: Publish to crates.io
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish inky-core
run: cargo publish -p inky-core
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish inky-cli
run: cargo publish -p inky-cli
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-npm:
name: Publish to npm
needs: [release]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
registry-url: https://registry.npmjs.org
- name: Download WASM artifact
uses: actions/download-artifact@v5
with:
name: wasm-nodejs
path: .
- name: Extract and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
tar xzf inky-nodejs.tar.gz
cd node
VERSION=$(node -p "require('./package.json').version")
if echo "$VERSION" | grep -qE '(alpha|beta|rc|dev)'; then
npm publish --access public --tag beta
else
npm publish --access public
fi
publish-pypi:
name: Publish to PyPI
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Build and publish
run: |
pip install build twine
cd bindings/python
python -m build
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
publish-rubygems:
name: Publish to RubyGems
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Build and publish
run: |
cd bindings/ruby
gem build inky-email.gemspec
GEM_FILE=$(ls inky-email-*.gem | head -1)
gem push "$GEM_FILE"
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
sync-php-split:
name: Sync PHP split repo (Packagist)
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Split bindings/php and push to foundation/inky-php
env:
TOKEN: ${{ secrets.PHP_SPLIT_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
SPLIT_SHA=$(git subtree split --prefix=bindings/php HEAD)
git push --force "https://x-access-token:${TOKEN}@github.com/foundation/inky-php.git" "${SPLIT_SHA}:refs/heads/main"
git push "https://x-access-token:${TOKEN}@github.com/foundation/inky-php.git" "${SPLIT_SHA}:refs/tags/${GITHUB_REF_NAME}"