Skip to content

chore: bump version number #15

chore: bump version number

chore: bump version number #15

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose
- name: Doc tests
run: cargo test --doc
release:
name: Build & Release Cross-Platform
needs: test
if: startswith(github.ref, 'refs/tags/v')
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
ext: ""
- os: macos-latest
target: x86_64-apple-darwin
ext: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: ".exe"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install target
run: rustup target add ${{ matrix.target }}
- name: Build binary
run: cargo build --release --target ${{ matrix.target }}
- name: Rename and zip binary
shell: bash
run: |
mkdir dist
cp target/${{ matrix.target }}/release/hh${{ matrix.ext }} dist/hh-${{ matrix.target }}${{ matrix.ext }}
# Only run zip if not Windows
- name: Zip binary (non-Windows)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cd dist
zip hh-${{ matrix.target }}.zip hh-${{ matrix.target }}${{ matrix.ext }}
- name: Zip binary (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path dist/hh-${{ matrix.target }}.exe -DestinationPath dist/hh-${{ matrix.target }}.zip
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
name: ${{ github.ref_name }}
files: dist/*.zip
publish:
name: Publish to crates.io
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}