-
-
Notifications
You must be signed in to change notification settings - Fork 163
137 lines (125 loc) · 4.78 KB
/
ci.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
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
name: Nightly Release CI
on:
push:
branches:
- v2-dev
permissions:
contents: write
pull-requests: write
packages: write
jobs:
call-rust-build:
uses: ./.github/workflows/rust-build.yaml
check-core-artifacts:
name: Check Core Artifacts
runs-on: ubuntu-latest
needs: call-rust-build
steps:
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
- name: Check
run: |
for abi in linux-x64-gnu darwin-x64 darwin-arm64
do
test -f /tmp/artifacts/${{ github.sha }}-${abi}/farm.${abi}.node
done
check-create-farm-rust-artifacts:
name: Check Create Farm Rust Artifacts
runs-on: ubuntu-latest
needs: call-rust-build
steps:
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
- name: Check
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc android-arm64 linux-arm-gnueabihf android-arm-eabi
do
ls /tmp/artifacts/
test -f /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/create-farm.${abi}.node
done
check-plugin-artifacts:
name: Check ${{ matrix.settings.name }} Artifacts
runs-on: ubuntu-latest
needs: call-rust-build
strategy:
fail-fast: false
matrix:
settings:
- name: plugin-sass
- name: plugin-react
- name: plugin-replace-dirname
steps:
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
- name: Check
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
test -f /tmp/artifacts/${{ github.sha }}-${abi}-${{ matrix.settings.name }}/index.farm
done
nightly-release:
name: Nightly Release
needs: [call-rust-build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
# 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 darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
mv /tmp/artifacts/${{ github.sha }}-${abi}/* ./packages/core/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-react/* ./rust-plugins/react/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-replace-dirname/* ./rust-plugins/replace-dirname/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-sass/* ./rust-plugins/sass/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/* ./packages/create-farm/npm/${abi}
test -f ./packages/core/npm/${abi}/farm.${abi}.node
test -f ./packages/create-farm/npm/${abi}/create-farm.${abi}.node
test -f ./rust-plugins/react/npm/${abi}/index.farm
test -f ./rust-plugins/replace-dirname/npm/${abi}/index.farm
test -f ./rust-plugins/sass/npm/${abi}/index.farm
done
for abi in android-arm-eabi linux-arm-gnueabihf android-arm64
do
mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/* ./packages/create-farm/npm/${abi}
test -f ./packages/create-farm/npm/${abi}/create-farm.${abi}.node
done
- name: Install Dependencies
run: npm install -g pnpm@9.4.0 && pnpm i --frozen-lockfile
- name: Build Plugin Tools
run: pnpm --filter @farmfe/plugin-tools run build
- name: Create Nightly Release Pull Request or Publish Nightly Version to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm run bump:nightly
publish: npm run release:nightly
branch: v2-dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Comment PR
# uses: actions/github-script@v6
# if: success()
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: '🎉 Nightly version has been published to npm!'
# })