v0.5.3 #42
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: Build and release binaries | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Build and Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
asset_name: bigtools-linux-gnu-noremote | |
remote: false | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
asset_name: bigtools-linux-gnu | |
remote: true | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
asset_name: bigtools-windows-msvc | |
remote: true | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
asset_name: bigtools-apple-darwin | |
remote: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Build project | |
run: | | |
rustup target add ${{ matrix.target }} | |
cargo build -p bigtools --release --locked -Z unstable-options --out-dir release --no-default-features --features cli ${{ matrix.remote && '--features remote' || '' }} --target ${{ matrix.target }} | |
- name: Archive Release | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: ${{ github.workspace }}/${{ matrix.asset_name }}.zip | |
exclusions: '*.git* /*node_modules/* .editorconfig' | |
path: release/ | |
- name: Zip upload | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ github.workspace }}/${{ matrix.asset_name }}.zip | |
publish: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cargo publish | |
run: cargo publish -p bigtools --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --features cli --features remote | |
env: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |