Skip to content

Merge pull request #11 from ziinaio/fix/debug-print-artifact #26

Merge pull request #11 from ziinaio/fix/debug-print-artifact

Merge pull request #11 from ziinaio/fix/debug-print-artifact #26

Workflow file for this run

name: Build and Release Ziina
on:
push:
branches: [main]
tags:
- 'v*'
pull_request:
workflow_dispatch:
permissions:
contents: write # Needed to create releases
jobs:
build:
name: Build for ${{ matrix.goos }} ${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.2'
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
BIN_NAME="ziina-${GOOS}-${GOARCH}"
GOOS=${GOOS} GOARCH=${GOARCH} go build -o dist/$BIN_NAME .
echo "BIN_NAME=$BIN_NAME" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BIN_NAME }}
path: dist/${{ env.BIN_NAME }}
release:
name: Create GitHub Release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Ziina ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}