Skip to content

Add goreleaser configuration to push Windows package to Chocolatey #110

Add goreleaser configuration to push Windows package to Chocolatey

Add goreleaser configuration to push Windows package to Chocolatey #110

Workflow file for this run

---
name: "Release"
on: # yamllint disable-line rule:truthy
push:
tags:
- "*"
permissions:
contents: "write"
packages: "write"
jobs:
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- uses: "authzed/actions/setup-go@main"
- uses: "nowsprinting/check-version-format-action@v4"
id: "version"
with:
prefix: "v"
- name: "Fail for an invalid version"
if: "${{ !startsWith(github.ref_name, 'v') || steps.version.outputs.is_valid != 'true' }}"
run: 'echo "SpiceDB version must start with `v` and be a semver" && exit 1'
shell: "bash"
- name: "Install snapcraft"
run: |
sudo snap install snapcraft --channel=8.x/stable --classic
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- uses: "authzed/actions/docker-login@main"
with:
quayio_token: "${{ secrets.QUAYIO_PASSWORD }}"
github_token: "${{ secrets.GITHUB_TOKEN }}"
dockerhub_token: "${{ secrets.DOCKERHUB_ACCESS_TOKEN }}"
- uses: "docker/setup-qemu-action@v3"
- uses: "docker/setup-buildx-action@v3"
- uses: "goreleaser/goreleaser-action@v5"
with:
distribution: "goreleaser-pro"
version: "latest"
args: "release --clean"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
HOMEBREW_TAP_GITHUB_TOKEN: "${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}"
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
GEMFURY_PUSH_TOKEN: "${{ secrets.GEMFURY_PUSH_TOKEN }}"
CHOCOLATEY_API_KEY: "${{ secrets.CHOCOLATEY_API_KEY }}"
- name: "Release snap"
env:
SNAPCRAFT_STORE_CREDENTIALS: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}"