-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
302 additions
and
96 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,128 @@ | ||
name: test-cross-use | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dryRun: | ||
description: '测试写这个为 true' | ||
required: true | ||
default: 'false' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
cross-: | ||
name: Test - ${{ matrix.platform.os-name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- os-name: FreeBSD-x86_64 | ||
runs-on: ubuntu-24.04 | ||
target: x86_64-unknown-freebsd | ||
|
||
- os-name: aarch64-unknown-linux-gnu | ||
runs-on: ubuntu-24.04 | ||
target: aarch64-unknown-linux-gnu | ||
|
||
- os-name: x86_64-unknown-linux-gnu | ||
runs-on: ubuntu-24.04 | ||
target: x86_64-unknown-linux-gnu | ||
|
||
# - os-name: Linux-x86_64-musl | ||
# runs-on: ubuntu-20.04 | ||
# target: x86_64-unknown-linux-musl | ||
|
||
# - os-name: Linux-aarch64-musl | ||
# runs-on: ubuntu-20.04 | ||
# target: aarch64-unknown-linux-musl | ||
|
||
- os-name: Linux-riscv64 | ||
runs-on: ubuntu-20.04 | ||
target: riscv64gc-unknown-linux-gnu | ||
|
||
- os-name: Linux-s390x | ||
runs-on: ubuntu-20.04 | ||
target: s390x-unknown-linux-gnu | ||
|
||
- os-name: Windows-x86_64-msvc | ||
runs-on: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
|
||
- os-name: Windows-x86_64-aarch64 | ||
runs-on: windows-latest | ||
target: aarch64-pc-windows-msvc | ||
|
||
- os-name: Windows-x86_64-gnu | ||
runs-on: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
|
||
- os-name: macOS-x86_64 | ||
runs-on: macOS-latest | ||
target: x86_64-apple-darwin | ||
|
||
- os-name: macOS-aarch64 | ||
runs-on: macOS-latest | ||
target: aarch64-apple-darwin | ||
|
||
# more targets here ... | ||
env: | ||
TZ: Asia/Shanghai | ||
runs-on: ${{ matrix.platform.runs-on }} | ||
steps: | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install cn-font-split -g | ||
cn-font-split ls | ||
- name: Create index.mjs file | ||
if: ${{ runner.os != 'Windows' }} | ||
run: | | ||
cat > index.mjs <<EOL | ||
import unzipper from "unzipper"; | ||
fetch( | ||
"https://github.com/atelier-anchor/smiley-sans/releases/download/v2.0.1/smiley-sans-v2.0.1.zip" | ||
) | ||
.then((res) => res.arrayBuffer()) | ||
.then(async (res) => { | ||
const directory = await unzipper.Open.buffer(Buffer.from(res)); | ||
await directory.extract({ path: "./" }); | ||
}); | ||
EOL | ||
- name: Create index.mjs file | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
$content = @' | ||
import unzipper from "unzipper"; | ||
fetch( | ||
"https://github.com/atelier-anchor/smiley-sans/releases/download/v2.0.1/smiley-sans-v2.0.1.zip" | ||
) | ||
.then((res) => res.arrayBuffer()) | ||
.then(async (res) => { | ||
const directory = await unzipper.Open.buffer(Buffer.from(res)); | ||
await directory.extract({ path: "./" }); | ||
}); | ||
'@ | ||
Set-Content -Path index.mjs -Value $content | ||
- name: Install unzipper | ||
run: | | ||
npm init -y | ||
npm install unzipper | ||
node index.mjs | ||
- name: build | ||
run: | | ||
cn-font-split -i ./SmileySans-Oblique.otf -o ./dist/ | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-${{ matrix.platform.target }}-${{hashFiles('dist/**/*.woff2')}} | ||
path: ./dist/**/* | ||
if-no-files-found: error |
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
Oops, something went wrong.