Release #8
Workflow file for this run
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
name: Release | |
defaults: | |
run: | |
shell: bash | |
on: | |
push: | |
tags: ["v[0-9]+.[0-9]+.[0-9]+*"] | |
jobs: | |
check_if_safe: | |
name: Check if safe to release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy, rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets --all-features | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
release: | |
needs: check_if_safe | |
name: Build and Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact_name: yarn-why | |
asset_name: yarn-why-linux-amd64 | |
- os: macos-latest | |
artifact_name: yarn-why | |
asset_name: yarn-why-macos-amd64 | |
- os: windows-latest | |
artifact_name: yarn-why.exe | |
asset_name: yarn-why-windows-amd64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: cargo build --release --locked | |
- name: Upload binary to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/release/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
macos_arm: | |
needs: check_if_safe | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ARM target | |
run: rustup update && rustup target add aarch64-apple-darwin | |
- name: Test | |
run: cargo test --release | |
- name: Build ARM | |
run: cargo build --release --target=aarch64-apple-darwin | |
- name: Upload binary to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/release/yarn-why | |
asset_name: yarn-why-macos-aarch64 | |
tag: ${{ github.ref }} | |
overwrite: true |