Skip to content

chore: fix hint and bump version #24

chore: fix hint and bump version

chore: fix hint and bump version #24

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
# Build binaries for all platforms
build:
name: Build ${{ matrix.target }}${{ matrix.suffix }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive: tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
archive: tar.gz
cross: true
- target: x86_64-apple-darwin
os: macos-latest
archive: tar.gz
- target: aarch64-apple-darwin
os: macos-latest
archive: tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
archive: zip
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross (for cross-compilation)
if: matrix.cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build binary
shell: bash
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi
- name: Prepare artifacts (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
VERSION="${GITHUB_REF#refs/tags/}"
BINARY="govctl"
ARCHIVE_NAME="govctl-${VERSION}-${{ matrix.target }}"
mkdir -p "dist/${ARCHIVE_NAME}"
cp "target/${{ matrix.target }}/release/${BINARY}" "dist/${ARCHIVE_NAME}/"
cp README.md LICENSE* "dist/${ARCHIVE_NAME}/" 2>/dev/null || true
cd dist
tar -czvf "${ARCHIVE_NAME}.tar.gz" "${ARCHIVE_NAME}"
echo "ASSET=${ARCHIVE_NAME}.tar.gz" >> $GITHUB_ENV
- name: Prepare artifacts (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$VERSION = $env:GITHUB_REF -replace 'refs/tags/', ''
$ARCHIVE_NAME = "govctl-${VERSION}-${{ matrix.target }}"
New-Item -ItemType Directory -Force -Path "dist\${ARCHIVE_NAME}"
Copy-Item "target\${{ matrix.target }}\release\govctl.exe" "dist\${ARCHIVE_NAME}\"
Copy-Item README.md, LICENSE* -Destination "dist\${ARCHIVE_NAME}\" -ErrorAction SilentlyContinue
Compress-Archive -Path "dist\${ARCHIVE_NAME}" -DestinationPath "dist\${ARCHIVE_NAME}.zip"
echo "ASSET=${ARCHIVE_NAME}.zip" >> $env:GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ASSET }}
path: dist/${{ env.ASSET }}
retention-days: 1
# Create GitHub release with all artifacts
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: Extract version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.VERSION }}
draft: false
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
generate_release_notes: true
body: |
TUI is now enabled by default in release binaries.
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}