Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,39 @@ jobs:
push: true
file: "./Dockerfile.dev"
tags: raystack/frontier:dev
releaser:

# Fast release: Linux/amd64 binary + Docker image only
# This finishes first so users don't have to wait
release-fast:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23.1"
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser (fast - linux/amd64)
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: "~> v1"
args: release --clean -f .goreleaser-fast.yml
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }}

# Full release: All other platforms, appends to the release created above
release-full:
runs-on: ubuntu-latest
needs: release-fast
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -48,7 +79,7 @@ jobs:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
- name: Run GoReleaser (full - remaining platforms)
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
Expand Down
64 changes: 64 additions & 0 deletions .goreleaser-fast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
project_name: frontier

release:
prerelease: auto

before:
hooks:
- make ui

builds:
- id: "frontier"
goos:
- linux
goarch:
- amd64
binary: frontier
main: ./main.go
ldflags:
- -s -w -X github.com/raystack/frontier/config.Version={{.Tag}}
- -X github.com/raystack/frontier/config.BuildCommit={{.FullCommit}}
- -X github.com/raystack/frontier/config.BuildDate={{.Date}}
env:
- CGO_ENABLED=0

archives:
- id: "frontier-archive"
format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}

checksum:
name_template: "checksums-linux-amd64.txt"

snapshot:
name_template: "{{ .Tag }}-next"

dockers:
- goos: linux
goarch: amd64
ids:
- frontier
dockerfile: Dockerfile
image_templates:
- "docker.io/raystack/{{.ProjectName}}:latest"
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}"
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64"

nfpms:
- maintainer: Raystack
description: Identity and authorization system
homepage: https://github.com/raystack/frontier
license: Apache 2.0
formats:
- deb
- rpm

# Skip changelog - full release will generate it
changelog:
disable: true
17 changes: 7 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ project_name: frontier

release:
prerelease: auto
# Append to the release created by fast releaser
mode: append

before:
hooks:
- make test
- make ui

builds:
Expand All @@ -17,6 +18,10 @@ builds:
goarch:
- amd64
- arm64
# Skip linux/amd64 - already built by fast releaser
ignore:
- goos: linux
goarch: amd64
binary: frontier
main: ./main.go
ldflags:
Expand Down Expand Up @@ -55,15 +60,7 @@ snapshot:
name_template: "{{ .Tag }}-next"

dockers:
- goos: linux
goarch: amd64
ids:
- frontier
dockerfile: Dockerfile
image_templates:
- "docker.io/raystack/{{.ProjectName}}:latest"
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}"
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64"
# linux/amd64 Docker image is built by fast releaser
- goos: linux
goarch: arm64
ids:
Expand Down
Loading