-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(create-farm): add multiple platforms (#1689)
* build(create): add multiple platforms * chore(create): update meta data * chore(create): update napi meta data * chore(create): bump version * ci(build): use pnpm cache * ci(build): add target `armv7-linux-androideabi` * ci(build): remove zig * ci(build): only build `create-farm` * ci(build): update setup node action to v4 * ci(build): add debug action * ci(build): try use zig abi * ci(build): remove zig for android * ci(build): fix android abi name * ci(build): add build script * ci(build): fix file list * ci(build): add target for android * ci(build): support `86_64-apple-darwin` * ci(build): add target * chore: update download action to v4 * ci(build): add 2 arch for` create-farm` * ci(build): fix target * ci(build): fix gcc link * ci(build): fix gcc link library * build(cargo): fix linker * ci(build): setup zig * ci(build): fix abi name * ci(check): check create farm artifacts * ci(release): move release artifacts * chore(cspell): fix words * ci(build): fix abi name * ci(build): fix `create-farm` artifacts check * ci(release): fix `android-arm64` abi name --------- Co-authored-by: brightwu <[email protected]>
- Loading branch information
Showing
26 changed files
with
325 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-farm": patch | ||
--- | ||
|
||
Add multiple platforms for `create-farm` and update meta data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,25 +32,25 @@ jobs: | |
- name: Install Dependencies | ||
run: npm install -g [email protected] && pnpm i --frozen-lockfile | ||
|
||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }} | ||
path: ./packages/core/binding | ||
|
||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download-plugin-sass | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-sass | ||
path: ./rust-plugins/sass/npm/${{ matrix.settings.abi }} | ||
|
||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download-plugin-react | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-react | ||
path: ./rust-plugins/react/npm/${{ matrix.settings.abi }} | ||
|
||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download-create-farm-rust | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }} | ||
|
@@ -128,7 +128,7 @@ jobs: | |
run: npm install -g [email protected] && pnpm i --frozen-lockfile | ||
- name: Build CLI and Core | ||
run: pnpm --filter @farmfe/cli run build | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }} | ||
|
@@ -146,7 +146,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: call-rust-build | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
- name: Check | ||
|
@@ -161,12 +161,12 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: call-rust-build | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- 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 | ||
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 | ||
|
@@ -183,7 +183,7 @@ jobs: | |
- name: plugin-sass | ||
- name: plugin-react | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
- name: Check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ jobs: | |
run: npm install -g [email protected] && pnpm i --frozen-lockfile | ||
- name: Build CLI and Core | ||
run: pnpm --filter @farmfe/cli run build | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
node-version: 18.x | ||
|
||
# batch download artifacts | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
- name: Copy Farm Core Binary | ||
|
@@ -43,6 +43,11 @@ jobs: | |
test -f ./rust-plugins/react/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 [email protected] && pnpm i --frozen-lockfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,10 +41,13 @@ jobs: | |
- os: windows-latest | ||
abi: win32-x64-msvc | ||
target: x86_64-pc-windows-msvc | ||
- os: macos-13 | ||
abi: darwin-x64 | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
abi: darwin-arm64 | ||
target: aarch64-apple-darwin | ||
|
||
# cross compile | ||
# windows. Note swc plugins is not supported on ia32 and arm64 | ||
|
@@ -78,27 +81,46 @@ jobs: | |
abi: linux-arm64-gnu | ||
target: aarch64-unknown-linux-gnu | ||
zig: true | ||
# - os: ubuntu-latest | ||
# abi: darwin-x64 | ||
# target: x86_64-apple-darwin | ||
# osxcross: true | ||
# zig: true | ||
# - os: ubuntu-latest | ||
# abi: darwin-arm64 | ||
# target: aarch64-apple-darwin | ||
# osxcross: true | ||
# zig: true | ||
# Build for Create Farm CLI only | ||
- os: ubuntu-latest | ||
abi: android-arm-eabi | ||
target: armv7-linux-androideabi | ||
build: pnpm --filter create-farm build --target armv7-linux-androideabi | ||
cli_only: true | ||
zig: false | ||
- os: ubuntu-latest | ||
abi: linux-arm-gnueabihf | ||
target: armv7-unknown-linux-gnueabihf | ||
build: >- | ||
sudo apt-get update && sudo apt-get install gcc-arm-linux-gnueabihf -y && | ||
pnpm --filter create-farm build --target armv7-unknown-linux-gnueabihf --zig | ||
cli_only: true | ||
zig: true | ||
- os: ubuntu-latest | ||
abi: android-arm64 | ||
target: aarch64-linux-android | ||
build: pnpm --filter create-farm build --target aarch64-linux-android | ||
cli_only: true | ||
zig: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Cache rust artifacts | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: rust-build-${{ matrix.settings.abi }} | ||
- uses: actions/setup-node@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.1.0 | ||
run_install: false | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- name: Install Dependencies | ||
run: npm install -g [email protected] && pnpm i --frozen-lockfile | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Build Plugin Tools | ||
run: pnpm --filter @farmfe/plugin-tools run build | ||
- run: rustup target add ${{ matrix.settings.target }} | ||
|
@@ -133,23 +155,29 @@ jobs: | |
if: ${{ !matrix.settings.docker && matrix.settings.build }} | ||
run: ${{ matrix.settings.build }} | ||
shell: bash | ||
- name: LS Create Farm Rust | ||
if: ${{ matrix.settings.cli_only }} | ||
run: ls -la ./packages/create-farm/ | ||
- name: Upload Core | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !matrix.settings.cli_only }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }} | ||
path: ./packages/core/binding/farm.${{ matrix.settings.abi }}.node | ||
- name: Upload Create Farm Rust | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }}-create-farm | ||
path: ./packages/create-farm/create-farm.${{ matrix.settings.abi }}.node | ||
- name: Upload Plugin React | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !matrix.settings.cli_only }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-react | ||
path: rust-plugins/react/npm/${{ matrix.settings.abi }}/index.farm | ||
- name: Upload Plugin Sass | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !matrix.settings.cli_only }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-sass | ||
path: rust-plugins/sass/npm/${{ matrix.settings.abi }}/index.farm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `create-farm-android-arm-eabi` | ||
|
||
This is the **armv7-linux-androideabi** binary for `create-farm` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "create-farm-android-arm-eabi", | ||
"version": "0.0.12", | ||
"os": [ | ||
"android" | ||
], | ||
"cpu": [ | ||
"arm" | ||
], | ||
"main": "create-farm.android-arm-eabi.node", | ||
"files": [ | ||
"create-farm.android-arm-eabi.node" | ||
], | ||
"description": "Rapidly create a new farm project.", | ||
"keywords": [ | ||
"farm", | ||
"create-farm" | ||
], | ||
"author": "", | ||
"homepage": "https://www.farmfe.org/docs/quick-start#create-a-farm-project", | ||
"license": "ISC", | ||
"repository": "https:/farm-fe/farm/tree/main/packages/create-farm", | ||
"bugs": { | ||
"url": "https:/farm-fe/farm/issues" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `create-farm-android-arm64` | ||
|
||
This is the **aarch64-linux-android** binary for `create-farm` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "create-farm-android-arm64", | ||
"version": "0.0.12", | ||
"os": [ | ||
"android" | ||
], | ||
"cpu": [ | ||
"arm64" | ||
], | ||
"main": "create-farm.android-arm64.node", | ||
"files": [ | ||
"create-farm.android-arm64.node" | ||
], | ||
"description": "Rapidly create a new farm project.", | ||
"keywords": [ | ||
"farm", | ||
"create-farm" | ||
], | ||
"author": "", | ||
"homepage": "https://www.farmfe.org/docs/quick-start#create-a-farm-project", | ||
"license": "ISC", | ||
"repository": "https:/farm-fe/farm/tree/main/packages/create-farm", | ||
"bugs": { | ||
"url": "https:/farm-fe/farm/issues" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `create-farm-freebsd-x64` | ||
|
||
This is the **x86_64-unknown-freebsd** binary for `create-farm` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "create-farm-freebsd-x64", | ||
"version": "0.0.12", | ||
"os": [ | ||
"freebsd" | ||
], | ||
"cpu": [ | ||
"x64" | ||
], | ||
"main": "create-farm.freebsd-x64.node", | ||
"files": [ | ||
"create-farm.freebsd-x64.node" | ||
], | ||
"description": "Rapidly create a new farm project.", | ||
"keywords": [ | ||
"farm", | ||
"create-farm" | ||
], | ||
"author": "", | ||
"homepage": "https://www.farmfe.org/docs/quick-start#create-a-farm-project", | ||
"license": "ISC", | ||
"repository": "https:/farm-fe/farm/tree/main/packages/create-farm", | ||
"bugs": { | ||
"url": "https:/farm-fe/farm/issues" | ||
} | ||
} |
Oops, something went wrong.