-
-
Notifications
You must be signed in to change notification settings - Fork 173
65 lines (52 loc) · 1.89 KB
/
preview-commit.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
# https://github.com/stackblitz-labs/pkg.pr.new
name: Preview Commit
on: [pull_request]
jobs:
build:
name: Build bindings and node packages
uses: ./.github/workflows/rust-build.yml
publish:
if: github.repository == 'farm-fe/farm'
name: Pkg Preview
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Git Reset Hard
run: git reset --hard # fix pnpm install add new line for package.json
# - name: Download Binding Artifacts
# uses: actions/download-artifact@v4
# with:
# path: packages/rolldown/artifacts
# - name: Move Binding Artifacts
# run: pnpm --filter rolldown artifacts
# - name: List Rolldown Bindings
# run: ls -R ./packages/rolldown/npm
# shell: bash
# - name: Download Node Artifacts
# uses: actions/download-artifact@v4
# with:
# path: packages/rolldown/dist
# name: node-artifact
# batch download artifacts
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
- name: Copy Farm Core Binary
run: cp /tmp/artifacts/${{ github.sha }}-linux-x64-gnu/* ./packages/core/binding
- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl linux-arm64-musl linux-arm64-gnu
do
mv /tmp/artifacts/${{ github.sha }}-${abi}/* ./packages/core/npm/${abi}
test -f ./packages/core/npm/${abi}/farm.${abi}.node
done
- name: Copy Licenses
run: |
find ./packages/ -type d -maxdepth 1 -exec cp LICENSE {} \;
find ./packages/ -type d -maxdepth 1 -exec cp THIRD-PARTY-LICENSE {} \;
- name: Release
run: pnpx pkg-pr-new publish --compact --pnpm './packages/core/npm/*' './packages/core'