Skip to content

cli-v1.4.2

cli-v1.4.2 #9

Workflow file for this run

on:
release:
types: [published]
name: Cargo Publish
jobs:
publish_crate:
name: Cargo Publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish crate
run: |
TAG_NAME=${{ github.event.release.tag_name }}
PREFIX=$(echo $TAG_NAME | cut -d'-' -f1)
case "$PREFIX" in
"sdf")
CRATE_NAME="sdf_glyph_renderer"
;;
"tools")
CRATE_NAME="pbf_font_tools"
;;
"cli")
CRATE_NAME="build_pbf_glyphs"
;;
*)
echo "Invalid prefix in tag: $PREFIX"
exit 1
esac
cargo publish --all-features -p $CRATE_NAME
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish_cli_binary:
name: Release build with ${{ matrix.os }}
if: startsWith(github.event.release.tag_name, 'cli-')
strategy:
fail-fast: true
# TODO: Not sure I agree with this setup of different runners; seems like we should use cross or something
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --release
- name: Push Artifacts
run: |
mv target/release/build_pbf_glyphs target/release/build_pbf_glyphs.${{ matrix.target }}
gh release upload ${{ github.event.release.tag_name }} target/release/build_pbf_glyphs.${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}