Skip to content

Allium v2 (#6)

Allium v2 (#6) #12

name: Release Artifacts
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
rust-binaries:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.cross
run: cargo install cross --locked
- name: Build
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }} -p allium-cli
else
cargo build --release --target ${{ matrix.target }} -p allium-cli
fi
- name: Package
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../allium-${{ matrix.target }}.tar.gz allium
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: allium-${{ matrix.target }}
path: allium-${{ matrix.target }}.tar.gz
- name: Publish GitHub release asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: allium-${{ matrix.target }}.tar.gz
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Build release artifacts
run: npm run release:artifacts
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: allium-release-artifacts
path: artifacts/*
- name: Publish GitHub release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: artifacts/*