-
Notifications
You must be signed in to change notification settings - Fork 7
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
121 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: build | ||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
rust-target: x86_64-pc-windows-msvc | ||
platform: win32 | ||
arch: x64 | ||
- os: windows-latest | ||
rust-target: i686-pc-windows-msvc | ||
platform: win32 | ||
arch: ia32 | ||
- os: windows-latest | ||
rust-target: aarch64-pc-windows-msvc | ||
platform: win32 | ||
arch: arm64 | ||
- os: ubuntu-20.04 | ||
rust-target: x86_64-unknown-linux-gnu | ||
platform: linux | ||
arch: x64 | ||
- os: ubuntu-20.04 | ||
rust-target: aarch64-unknown-linux-gnu | ||
platform: linux | ||
arch: arm64 | ||
- os: ubuntu-20.04 | ||
rust-target: arm-unknown-linux-gnueabihf | ||
platform: linux | ||
arch: armhf | ||
- os: macos-11 | ||
rust-target: x86_64-apple-darwin | ||
platform: darwin | ||
arch: x64 | ||
- os: macos-11 | ||
rust-target: aarch64-apple-darwin | ||
platform: darwin | ||
arch: arm64 | ||
name: Build for ${{ matrix.platform }}-${{ matrix.arch }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Rust toolchains | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: ${{ matrix.rust-target }} | ||
- name: Install AArch64 target toolchain | ||
if: matrix.rust-target == 'aarch64-unknown-linux-gnu' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-aarch64-linux-gnu | ||
- name: Install ARM target toolchain | ||
if: matrix.rust-target == 'arm-unknown-linux-gnueabihf' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-arm-linux-gnueabihf | ||
- name: Cache cargo registry and index | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build | ||
run: | | ||
cargo clean | ||
cargo build --release --all-targets --all-features -vv | ||
- name: Upload build result | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.name }}-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: target/release/${{ inputs.name }}${{ fromJSON('[".exe", ""]')[matrix.platform == 'win32'] }} |
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 |
---|---|---|
|
@@ -9,13 +9,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install cargo-outdated | ||
uses: actions-rs/[email protected] | ||
|
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 |
---|---|---|
|
@@ -6,16 +6,14 @@ on: | |
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
|
||
tag_check_deps_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install cargo-outdated | ||
uses: actions-rs/[email protected] | ||
with: | ||
|
@@ -36,36 +34,15 @@ jobs: | |
uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release_build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install freetype and fontconfig for macOS | ||
if: ${{ runner.os == 'macOS' }} | ||
run: | | ||
brew install pkg-config cmake freetype fontconfig | ||
pkg-config --libs --static fontconfig | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Build use release profile | ||
run: cargo build --all-targets --all-features -vv --release | ||
- name: Upload release binary to artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release-${{ runner.os }} | ||
path: target/release/fontfor | ||
|
||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: fontfor | ||
|
||
create_release: | ||
needs: [tag_check_deps_version, release_build] | ||
needs: [tag_check_deps_version, build] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_upload_url: ${{ steps.release.outputs.upload_url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -80,50 +57,13 @@ jobs: | |
message="${message//$'\n'/'%0A'}" | ||
message="${message//$'\r'/'%0D'}" | ||
echo "::set-output name=message::$message" | ||
- name: Create release | ||
id: release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.release_token }} | ||
- name: Download Linux binary from artifact | ||
uses: actions/download-artifact@v3 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ steps.tag.outputs.name }} | ||
token: ${{ secrets.release_token }} | ||
body: ${{ steps.tag.outputs.message }} | ||
draft: false | ||
prerelease: false | ||
upload_binary: | ||
needs: [create_release] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Download Linux binary from artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: release-Linux | ||
path: artifacts/release-Linux | ||
- name: Download macOS binary from artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: release-macOS | ||
path: artifacts/release-macOS | ||
- name: Show artifacts content | ||
run: ls -a -l -R artifacts | ||
- name: Upload Linux binary asset to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.release_upload_url }} | ||
asset_path: ./artifacts/release-Linux/fontfor | ||
asset_name: fontfor-Linux | ||
asset_content_type: application/octet-stream | ||
- name: Upload macOS binary asset to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.release_upload_url }} | ||
asset_path: ./artifacts/release-macOS/fontfor | ||
asset_name: fontfor-macOS | ||
asset_content_type: application/octet-stream | ||
files: fontfor-*/fontfor* |