Skip to content

feat(cli): add interactive TUI dashboard (#2) #1

feat(cli): add interactive TUI dashboard (#2)

feat(cli): add interactive TUI dashboard (#2) #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
BINARY_NAME: fgp
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: fgp-linux-x64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact: fgp-linux-arm64
cross: true
- target: x86_64-apple-darwin
os: macos-latest
artifact: fgp-macos-x64
- target: aarch64-apple-darwin
os: macos-latest
artifact: fgp-macos-arm64
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install cross
if: matrix.cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build (cross)
if: matrix.cross
run: cross build --release --target ${{ matrix.target }}
- name: Build (native)
if: ${{ !matrix.cross }}
run: cargo build --release --target ${{ matrix.target }}
- name: Package binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ matrix.artifact }}.tar.gz ${{ env.BINARY_NAME }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}.tar.gz
if-no-files-found: error
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: artifacts/**/*.tar.gz
publish-crates:
name: Publish to crates.io
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Verify version matches tag
run: |
VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
TAG=${GITHUB_REF#refs/tags/v}
if [ "$VERSION" != "$TAG" ]; then
echo "Version mismatch: Cargo.toml has $VERSION but tag is $TAG"
exit 1
fi
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
continue-on-error: true