Skip to content

Initial commit

Initial commit #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
archive: tar.gz
cross: true
- os: macos-latest
target: x86_64-apple-darwin
archive: tar.gz
- os: macos-latest
target: aarch64-apple-darwin
archive: tar.gz
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build (native)
if: ${{ !matrix.cross }}
run: cargo build --release --target ${{ matrix.target }} -p muninn
- name: Build (cross)
if: matrix.cross
run: cross build --release --target ${{ matrix.target }} -p muninn
- name: Package
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../muninn-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }} muninn
cd ../../..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: muninn-${{ matrix.target }}
path: muninn-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum muninn-* > SHA256SUMS
cat SHA256SUMS
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/muninn-*
artifacts/SHA256SUMS
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}