Skip to content

prepare for release

prepare for release #2

Workflow file for this run

on:
push:
tags:
- "v*"
name: Release
jobs:
# cargo_publish:
# name: Publish to crates.io
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Publish
# run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }}
create_release:
name: Create draft release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create draft release
run: gh release create ${{ github.ref_name }} --notes-file CHANGELOG.md --draft
build:
name: Build binaries
needs: create_release
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCHIVE_NAME: fixit-${{ github.ref_name }}-${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Create archive
run: mv ./target/${{ matrix.target }}/release/fixit . && tar -czvf $ARCHIVE_NAME.tar.gz fixit
- name: Checksum
run: sha256sum $ARCHIVE_NAME.tar.gz > $ARCHIVE_NAME.sha256
- name: Upload artifacts
run: gh release upload ${{ github.ref_name }} $ARCHIVE_NAME.{tar.gz,sha256}
publish_release:
name: Publish release
runs-on: ubuntu-latest
needs: build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Publish release
run: gh release edit ${{ github.ref_name }} --draft=false