-
-
Notifications
You must be signed in to change notification settings - Fork 595
95 lines (81 loc) · 3.11 KB
/
release-canary.yml
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
# Release Canary by comment with "!canary"
name: Release Canary
on:
issue_comment:
types: [created]
jobs:
get-runner-labels:
name: Get Runner Labels
uses: ./.github/workflows/get-runner-labels.yml
build:
name: Build Canary
needs: [get-runner-labels]
if: github.event.issue.pull_request && contains(github.event.comment.body, '!canary')
strategy:
fail-fast: false # Build and test everything so we can look at all the errors
matrix:
array:
- target: x86_64-unknown-linux-gnu
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
- target: aarch64-unknown-linux-gnu
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
- target: x86_64-unknown-linux-musl
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
- target: aarch64-unknown-linux-musl
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
- target: i686-pc-windows-msvc
runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }}
- target: x86_64-pc-windows-msvc
runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }}
- target: aarch64-pc-windows-msvc
runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }}
- target: x86_64-apple-darwin
runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }}
- target: aarch64-apple-darwin
runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }}
uses: ./.github/workflows/reusable-build.yml
with:
ref: refs/pull/${{ github.event.issue.number }}/head
target: ${{ matrix.array.target }}
runner: ${{ matrix.array.runner }}
test: false
release:
name: Release Canary
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Pnpm Cache
uses: ./.github/actions/pnpm-cache
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Build node packages
run: pnpm run build:js
- name: Move artifacts
run: node scripts/build-npm.cjs
- name: Show binding packages
run: ls -R npm
- name: Resolve dependencies for bindings
run: pnpm install --no-frozen-lockfile
- name: Release
run: |
./x version snapshot
./x publish snapshot --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
PULL_REQUEST_NUMBER: ${{ github.event.issue.number }}
COMMENT: ${{ toJson(github.event.comment) }}
- name: Write a new comment
uses: peter-evans/create-or-update-comment@v4
continue-on-error: true
with:
issue-number: ${{ github.event.issue.number }}
body-path: 'version_output'