Skip to content

goreleaser

goreleaser #13

Workflow file for this run

# .github/workflows/release.yml
name: goreleaser
on:
push:
# run only against tags
tags:
- "*"
permissions:
contents: write
# packages: write
# issues: write
jobs:
build_chocolatey:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
shell: powershell
- name: Set up environment variables
run: echo "CHOCOLATEY_API_KEY=${{ secrets.CHOCOLATEY_API_KEY }}" >> $GITHUB_ENV
shell: bash
- name: Run GoReleaser for Chocolatey
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean --skip-publish --skip-validate --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
build_homebrew:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser for Homebrew
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean --skip-publish --skip-validate --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
goreleaser_publish:
runs-on: ubuntu-latest
needs: [build_chocolatey, build_homebrew]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run GoReleaser to Publish All
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}