Skip to content

release: bump sprocket to 0.9.0. (#35) #11

release: bump sprocket to 0.9.0. (#35)

release: bump sprocket to 0.9.0. (#35) #11

Workflow file for this run

name: Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Update Rust
run: rustup update stable && rustup default stable
- name: Update lock file
run: cargo update
- name: Publish to crates.io
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Create a GH release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
make_latest: true
build_artifacts:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- rust-target: x86_64-unknown-linux-gnu
os: ubuntu-latest
extension: tar.gz
- rust-target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
extension: tar.gz
- rust-target: x86_64-apple-darwin
os: macos-latest
extension: tar.gz
- rust-target: aarch64-apple-darwin
os: macos-latest
extension: tar.gz
- rust-target: x86_64-pc-windows-msvc
os: windows-latest
extension: zip
- rust-target: aarch64-pc-windows-msvc
os: windows-latest
extension: zip
steps:
- uses: actions/checkout@v4
- name: Update Rust
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.rust-target }}
- run: cargo build --release --target ${{ matrix.rust-target }}
if: ${{ ! matrix.cross }}
- run: cargo install cross
if: ${{ matrix.cross }}
- run: cross build --release --target ${{ matrix.rust-target }}
if: ${{ matrix.cross }}
- run: tar -czvf sprocket-${{ github.ref_name }}-${{ matrix.rust-target }}.tar.gz sprocket
working-directory: ./target/${{ matrix.rust-target }}/release
if: matrix.os != 'windows-latest'
- run: 7z a sprocket-${{ github.ref_name }}-${{ matrix.rust-target }}.zip sprocket.exe
working-directory: ./target/${{ matrix.rust-target }}/release
if: matrix.os == 'windows-latest'
- name: Update the GH release with the new artifact
uses: softprops/action-gh-release@v2
with:
files: ./target/${{ matrix.rust-target }}/release/sprocket-${{ github.ref_name }}-${{ matrix.rust-target }}.${{ matrix.extension }}