Skip to content

Commit

Permalink
Add goreleaser action
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Aug 27, 2024
1 parent b5314fa commit 44a3a8b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: goreleaser

on:
push:
tags:
- '*'

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

# We need buildx so we can do multi-arch Docker builds with goreleaser
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Goreleaser's auto-login doesn't work as expected, so we work around it
# by manually logging in using the actions provided GITHUB_TOKEN.
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: base16-builder-go
builds:
- env:
Expand Down

0 comments on commit 44a3a8b

Please sign in to comment.