Skip to content

Release v0.7.0

Release v0.7.0 #10

Workflow file for this run

name: Release
permissions:
contents: write
actions: write
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
name: Build ${{ matrix.target.name }} package
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target:
[
{ name: aarch64-apple-darwin, os: macos-latest },
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest },
{ name: x86_64-pc-windows-msvc, os: windows-latest },
]
steps:
- name: Fetch latest code
uses: actions/checkout@v5
- name: Setup Rust toolchain
run: rustup target add ${{ matrix.target.name }}
- name: Build
run: cargo build --profile ci-release --locked --target ${{ matrix.target.name }}
- name: Pack (macOS)
if: matrix.target.os == 'macos-latest'
run: |
mv target/${{ matrix.target.name }}/ci-release/cargo-featalign .
zip cargo-featalign-${{ matrix.target.name }}.zip cargo-featalign
- name: Pack (Windows)
if: matrix.target.os == 'windows-latest'
run: |
mv target/${{ matrix.target.name }}/ci-release/cargo-featalign.exe .
Compress-Archive -Path cargo-featalign.exe -DestinationPath cargo-featalign-${{ matrix.target.name }}.zip
- name: Pack (Linux)
if: matrix.target.os == 'ubuntu-latest'
run: |
mv target/${{ matrix.target.name }}/ci-release/cargo-featalign .
tar -czvf cargo-featalign-${{ matrix.target.name }}.tar.gz cargo-featalign
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: cargo-featalign-${{ matrix.target.name }}
path: cargo-featalign-${{ matrix.target.name }}.*
retention-days: 1
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v6
- name: Hash
run: |
mkdir -p artifacts
mv cargo-featalign-*/* artifacts/
cd artifacts
sha256sum * | tee ../SHA256
md5sum * | tee ../MD5
mv ../SHA256 .
mv ../MD5 .
- name: Publish
uses: ncipollo/release-action@v1
with:
discussionCategoryName: Announcements
generateReleaseNotes: true
artifacts: artifacts/*
publish-on-crates-io:
name: Publish on crates.io
runs-on: ubuntu-latest
steps:
- name: Fetch latest code
uses: actions/checkout@v5
- name: Login
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish
run: cargo publish --locked