Skip to content

Merge pull request #59 from siketyan/renovate/serde-monorepo #161

Merge pull request #59 from siketyan/renovate/serde-monorepo

Merge pull request #59 from siketyan/renovate/serde-monorepo #161

Workflow file for this run

name: Rust
on:
push: ~
release:
types:
- published
env:
CARGO_TERM_COLOR: always
jobs:
checks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-v1-${{ hashFiles('**/Cargo.lock') }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt,clippy
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
deploy:
if: ${{ github.event_name == 'release' }}
needs:
- checks
strategy:
matrix:
target:
# - x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-linux-gnu
include:
# - target: x86_64-pc-windows-msvc
# runner: windows-2022
# artifact: gh-labelx.exe
# name: gh-labelx-windows-amd64.exe
- target: x86_64-apple-darwin
runner: macos-12
artifact: gh-labelx
name: gh-labelx-darwin-amd64
- target: aarch64-apple-darwin
runner: macos-12
artifact: gh-labelx
name: gh-labelx-darwin-arm64
- target: x86_64-unknown-linux-gnu
runner: ubuntu-22.04
artifact: gh-labelx
name: gh-labelx-linux-amd64
publish: true
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-v1-${{ hashFiles('**/Cargo.toml') }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: ${{ matrix.target }}
- name: Log into crates.io
if: ${{ matrix.publish }}
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish to crates.io
if: ${{ matrix.publish }}
uses: actions-rs/cargo@v1
with:
command: publish
args: --allow-dirty
- uses: cli/gh-extension-precompile@v1
env:
TARGET: ${{ matrix.target }}
ARTIFACT: ${{ matrix.artifact }}
NAME: ${{ matrix.name }}
with:
build_script_override: "build.sh"