Files
streamed-tui/.github/workflows/release.yml
Salastil 04cffe35ae Release
2025-11-23 03:47:46 -05:00

99 lines
2.1 KiB
YAML

name: Build release binaries
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
BINARY_NAME: streamed-tui
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build raw binaries
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p dist
outfile="${BINARY_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}"
go build -o "dist/${outfile}" .
- name: Upload raw binary
uses: actions/upload-artifact@v4
with:
name: binaries
path: dist/${{ env.BINARY_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }}
if-no-files-found: error
source:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create source tarball
run: |
mkdir -p dist
tag="${GITHUB_REF_NAME}"
tar -czf "dist/${{ env.BINARY_NAME }}_${tag}_source.tar.gz" .
- name: Upload source artifact
uses: actions/upload-artifact@v4
with:
name: source
path: dist/*source.tar.gz
publish:
runs-on: ubuntu-latest
needs: [build, source]
permissions:
contents: write
steps:
- name: Download all artifacts flat
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish assets to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: dist/*