Skip to content

Commit

Permalink
Break out windows goreleaser config into its own file and build step,…
Browse files Browse the repository at this point in the history
… as it needs to run on a windows machine
  • Loading branch information
josephschorr committed Jul 3, 2024
1 parent ba76931 commit 15a4537
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 27 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ permissions:
contents: "write"
packages: "write"
jobs:
goreleaser-windows:
runs-on: "windows-latest"
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 (windows)"
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"
- 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@v6"
with:
distribution: "goreleaser-pro"
version: "latest"
args: "release --clean --config=.goreleaser.windows.yml"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
CHOCOLATEY_API_KEY: "${{ secrets.CHOCOLATEY_API_KEY }}"
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
Expand Down Expand Up @@ -45,7 +76,6 @@ jobs:
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 }}"
2 changes: 1 addition & 1 deletion .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: "Security"
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches:
- "!dependabot/*"
Expand Down
58 changes: 58 additions & 0 deletions .goreleaser.windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
git:
tag_sort: "-version:creatordate"
prerelease_suffix: "-"
before:
hooks:
- "go run mage.go gen:completions"
builds:
- main: "./cmd/spicedb"
env:
- "CGO_ENABLED=0"
goos:
- "windows"
goarch:
- "amd64"
- "arm64"
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- "-s -w"
- "-X github.com/jzelinskie/cobrautil/v2.Version=v{{ .Version }}"
archives:
- files:
- "README.md"
- "LICENSE"
- "completions/*"
format_overrides:
- goos: "windows"
format: "zip"
chocolateys:
- name: "spicedb"
package_source_url: "https://github.com/authzed/spicedb"
owners: "AuthZed, Inc"
title: "SpiceDB"
project_url: "https://github.com/authzed/spicedb"
use: "archive"
url_template: "https://github.com/authzed/spicedb/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
icon_url: "https://authzed.com/favicon.svg"
copyright: "2024 AuthZed, Inc"
license_url: "https://github.com/authzed/spicedb/blob/main/LICENSE"
project_source_url: "https://github.com/authzed/spicedb"
docs_url: "https://authzed.com/docs"
bug_tracker_url: "https://github.com/authzed/spicedb/issues"
tags: "spicedb zanzibar authz rebac rbac abac fga"
summary: "SpiceDB is a graph database purpose-built for storing and evaluating access control data."
description: |
Open Source, Google Zanzibar-inspired permissions database to enable fine-grained access control for customer applications
release_notes: "https://github.com/authzed/spicedb/releases/tag/v{{ .Version }}"
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
source_repo: "https://push.chocolatey.org/"
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
use: "github-native"
sort: "asc"
nightly:
name_template: "{{ incpatch .Version }}-{{ .ShortCommit }}"
25 changes: 0 additions & 25 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ builds:
- "CGO_ENABLED=0"
goos:
- "linux"
- "windows"
- "darwin"
goarch:
- "amd64"
Expand All @@ -25,30 +24,6 @@ archives:
- "README.md"
- "LICENSE"
- "completions/*"
format_overrides:
- goos: "windows"
format: "zip"
chocolateys:
- name: "spicedb"
package_source_url: "https://github.com/authzed/spicedb"
owners: "AuthZed, Inc"
title: "SpiceDB"
project_url: "https://github.com/authzed/spicedb"
use: "archive"
url_template: "https://github.com/authzed/spicedb/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
icon_url: "https://authzed.com/favicon.svg"
copyright: "2024 AuthZed, Inc"
license_url: "https://github.com/authzed/spicedb/blob/main/LICENSE"
project_source_url: "https://github.com/authzed/spicedb"
docs_url: "https://authzed.com/docs"
bug_tracker_url: "https://github.com/authzed/spicedb/issues"
tags: "spicedb zanzibar authz rebac rbac abac fga"
summary: "SpiceDB is a graph database purpose-built for storing and evaluating access control data."
description: |
Open Source, Google Zanzibar-inspired permissions database to enable fine-grained access control for customer applications
release_notes: "https://github.com/authzed/spicedb/releases/tag/v{{ .Version }}"
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
source_repo: "https://push.chocolatey.org/"
nfpms:
- vendor: "authzed inc."
homepage: "https://spicedb.io"
Expand Down

0 comments on commit 15a4537

Please sign in to comment.