Skip to content

Commit d5e2b12

Browse files
fu050409ErKeLostNirvana-Jiewre232114
authored
ci(create-farm): add support for freebsd (#1770)
* ci(build): add support for freebsd * ci(build): partially install dependencies * ci(build): update build path * ci(build): add debug expr * ci(build): install with lock file * ci(build): ignore scripts in freebsd * ci(release): update abi name * chore: bump version * ci(release): fix create-farm native file path --------- Co-authored-by: ADNY <[email protected]> Co-authored-by: Nirvana <[email protected]> Co-authored-by: brightwu <[email protected]>
1 parent 147edc3 commit d5e2b12

File tree

3 files changed

+59
-3
lines changed

3 files changed

+59
-3
lines changed

.changeset/young-oranges-give.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-farm": patch
3+
---
4+
5+
Add arch support for `freebsd-x64`

.github/workflows/release.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test -f ./rust-plugins/react/npm/${abi}/index.farm
4444
test -f ./rust-plugins/sass/npm/${abi}/index.farm
4545
done
46-
for abi in android-arm-eabi linux-arm-gnueabihf android-arm64
46+
for abi in android-arm-eabi linux-arm-gnueabihf android-arm64 freebsd-x64
4747
do
4848
mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/* ./packages/create-farm/npm/${abi}
4949
test -f ./packages/create-farm/npm/${abi}/create-farm.${abi}.node
@@ -58,8 +58,8 @@ jobs:
5858
id: changesets
5959
uses: changesets/action@v1
6060
with:
61-
version: pnpm run bump
62-
publish: npm run release
61+
version: pnpm bump
62+
publish: pnpm release
6363
env:
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/rust-build.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,54 @@ jobs:
183183
with:
184184
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-sass
185185
path: rust-plugins/sass/npm/${{ matrix.settings.abi }}/index.farm
186+
# Now for create-farm cli only builds
187+
build-freebsd:
188+
name: Build and Upload Artifacts - x86_64-unknown-freebsd
189+
runs-on: ubuntu-latest
190+
steps:
191+
- uses: actions/checkout@v4
192+
- name: Build
193+
id: build
194+
uses: cross-platform-actions/[email protected]
195+
env:
196+
DEBUG: napi:*
197+
RUSTUP_IO_THREADS: 1
198+
with:
199+
operating_system: freebsd
200+
version: '14.0'
201+
memory: 8G
202+
cpu_count: 3
203+
environment_variables: DEBUG RUSTUP_IO_THREADS
204+
shell: bash
205+
run: |
206+
sudo pkg install -y -f curl node libnghttp2 npm
207+
sudo npm install -g pnpm
208+
curl https://sh.rustup.rs -sSf --output rustup.sh
209+
sh rustup.sh -y --profile minimal --default-toolchain beta
210+
source "$HOME/.cargo/env"
211+
echo "~~~~ rustc --version ~~~~"
212+
rustc --version
213+
echo "~~~~ node -v ~~~~"
214+
node -v
215+
echo "~~~~ pnpm --version ~~~~"
216+
pnpm --version
217+
pwd
218+
ls -lah
219+
whoami
220+
env
221+
freebsd-version
222+
223+
echo "~~~~ Install dependencies ~~~~"
224+
cd packages/create-farm && pnpm i --frozen-lockfile --ignore-scripts
225+
echo "~~~~ Build ~~~~"
226+
pnpm build --target x86_64-unknown-freebsd
227+
echo "~~~~ ls -lah ~~~~"
228+
ls -lah
229+
230+
rm -rf node_modules
231+
rm -rf target
232+
- name: Upload Create Farm Rust
233+
uses: actions/upload-artifact@v4
234+
with:
235+
name: ${{ github.sha }}-x86_64-unknown-freebsd-create-farm
236+
path: ./packages/create-farm/create-farm.freebsd-x64.node

0 commit comments

Comments
 (0)