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 c81b3b6 commit 73cbe8a
Showing 1 changed file with 34 additions and 60 deletions.
94 changes: 34 additions & 60 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,42 @@
name: Release Build
# .github/workflows/release.yml
name: goreleaser

on:
pull_request:
push:
# run only against tags
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'
permissions:
contents: write
# packages: write
# issues: write
# id-token: write

- 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
jobs:
goreleaser:
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 }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

0 comments on commit 73cbe8a

Please # to comment.