-
-
Notifications
You must be signed in to change notification settings - Fork 827
96 lines (83 loc) · 3.04 KB
/
Copy pathpreview-commit.yml
File metadata and controls
96 lines (83 loc) · 3.04 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
# https://github.com/stackblitz-labs/pkg.pr.new
name: Preview Commit
on:
workflow_call:
permissions:
# Allow commenting on issues for `reusable-build.yml`
issues: write
jobs:
get-runner-labels:
name: Get Runner Labels
uses: ./.github/workflows/get-runner-labels.yml
with:
force-use-github-runner: false
check-changed:
runs-on: ubuntu-latest
name: Check Changed
outputs:
changed: ${{ steps.filter.outputs.changed == 'true' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
id: filter
with:
filters: |
changed:
- "crates/**"
- "packages/rspack/**"
- "packages/rspack-cli/**"
build:
needs: [get-runner-labels, check-changed]
if: needs.check-changed.outputs.changed == 'true'
strategy:
fail-fast: false
matrix:
array:
- target: x86_64-unknown-linux-gnu
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
- target: aarch64-unknown-linux-gnu
runner: "'ubuntu-latest'"
- 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:
target: ${{ matrix.array.target }}
runner: ${{ matrix.array.runner }}
profile: 'release'
test: false
publish:
if: github.repository == 'web-infra-dev/rspack'
name: Pkg Preview
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Pnpm Setup
uses: ./.github/actions/pnpm/setup
- name: Pnpm Install
run: pnpm i
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
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: Release
run: npx pkg-pr-new publish --compact --pnpm './npm/*' './crates/node_binding' './packages/rspack' './packages/rspack-cli'