Skip to content

Update release.yaml #1

Update release.yaml

Update release.yaml #1

Workflow file for this run

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 }}