-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (60 loc) · 1.86 KB
/
pre-release.yaml
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
name: Pre-release
on:
pull_request:
branches:
- "main"
types: [opened,labeled,edited,synchronize]
jobs:
test-artifacts:
if: contains(github.event.pull_request.labels.*.name, 'release')
env:
RUST_BACKTRACE: 1
RUST_LIB_BACKTRACE: 1
TOKIO_WORKER_THREADS: 1
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
command: test
- target: x86_64-apple-darwin
os: macos-latest
command: build
- target: aarch64-apple-darwin
os: macos-latest
command: test
# - target: x86_64-pc-windows-msvc
# os: windows-latest
# command: test
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20.15.0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.13.2
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Cross-compile
run: cargo ${{ matrix.command }} --locked --target ${{ matrix.target }}
publish-dry-run:
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Dry run of crate publish
run: cargo publish -p depot-js --dry-run
check-pr-name:
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Check that PR name is a release number
run: echo "${{ github.event.pull_request.title }}" | grep -q -E "^v[0-9]+\.[0-9]+\.[0-9]+$"