Skip to content

Commit

Permalink
Update release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rarrifano authored Mar 1, 2025
1 parent 78d91a0 commit c81b3b6
Showing 1 changed file with 61 additions and 14 deletions.
75 changes: 61 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,68 @@
# .github/workflows/release.yaml
name: Release Build

on:
release:
types: [created]

permissions:
contents: write
packages: write
push:
tags:
- 'v*'

jobs:
release-linux-amd64:
name: release linux/amd64
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:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
- 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:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
draft: true
files: |
release/zettel-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c81b3b6

Please # to comment.