Update release.yaml #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64] | |
exclude: | |
- goos: windows | |
goarch: arm64 | |
- goos: darwin | |
goarch: arm64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Build | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
run: | | |
output_name="zettel-${{ matrix.goos }}-${{ matrix.goarch }}" | |
if [ "${{ matrix.goos }}" = "windows" ]; then | |
output_name="$output_name.exe" | |
fi | |
go build -o $output_name . | |
mkdir release | |
mv $output_name release/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries | |
path: release/ | |
retention-days: 1 | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: binaries | |
path: release | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
release/zettel-* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |