Skip to content

test-cross-use

test-cross-use #5

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/**/*')}}
path: ./dist/**/*
if-no-files-found: error