Skip to content

Prepare Releases

Prepare Releases #42

Workflow file for this run

name: Prepare Releases
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: release ${{ matrix.platform.os-name }}
strategy:
fail-fast: false
matrix:
platform:
- os-name: linux-x86_64
runs-on: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os-name: linux-aarch64
runs-on: ubuntu-22.04
target: aarch64-unknown-linux-gnu
- os-name: windows-msvc
runs-on: windows-latest
target: x86_64-pc-windows-msvc
- os-name: macOS-x86_64
runs-on: macOS-latest
target: x86_64-apple-darwin
- os-name: macOS-aarch64
runs-on: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build release binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: "build"
toolchain: "nightly"
target: ${{ matrix.platform.target }}
args: "--locked --release --bin=nmo"
strip: true
- name: Build archive
shell: bash
run: |
name="${{ format('nemo_{0}_{1}', github.ref_name, matrix.platform.target) }}"
mkdir -p "$name"
cp {README.md,LICENSE-APACHE,LICENSE-MIT} "$name"
if [ "${{ matrix.platform.runs-on }}" = "windows-latest" ]; then
cp "target/${{ matrix.platform.target }}/release/nmo.exe" "$name/"
asset=$name.zip
7z a "$asset" "$name"
echo ASSET=$asset >> $GITHUB_ENV
else
cp "target/${{ matrix.platform.target }}/release/nmo" "$name/"
asset=$name.tar.gz
tar czf "$asset" "$name"
echo ASSET=$asset >> $GITHUB_ENV
fi
if [ "${{ matrix.platform.runs-on }}" = "macOS-latest" ]; then
shasum -a 256 "$asset" > "$asset.sha256sum"
else
sha256sum "$asset" > "$asset.sha256sum"
fi
- name: Create (draft) release
uses: softprops/action-gh-release@v2
with:
name: "Nemo ${{ github.ref_name }}"
fail_on_unmatched_files: false
generate_release_notes: true
make_latest: true
draft: true
files: |
nemo_*.zip
nemo_*.tar.gz
nemo_*.zip.sha256sum
nemo_*.tar.gz.sha256sum