From a648c10b8329dd963206a619aa0f48366ebe945e Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Wed, 17 Dec 2025 14:54:35 +0530 Subject: [PATCH 1/4] feat: speed up release by prioritizing linux/amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split GoReleaser into two stages: - Fast release: linux/amd64 binary + Docker image (what users wait for) - Full release: remaining platforms, appends to existing release Changes: - Add .goreleaser-fast.yml for linux/amd64 only - Update .goreleaser.yml to exclude linux/amd64 and use append mode - Split workflow into test -> release-fast -> release-full - Move tests to dedicated prerequisite job instead of GoReleaser hook 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release.yml | 51 ++++++++++++++++++++++++++++++-- .goreleaser-fast.yml | 55 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 17 +++++------ 3 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 .goreleaser-fast.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55a6d861d..a7736c068 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,8 +7,23 @@ on: workflow_dispatch: jobs: + test: + 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: Run tests + run: make test + dev: runs-on: ubuntu-latest + needs: test steps: - name: Checkout code uses: actions/checkout@v3 @@ -31,8 +46,40 @@ 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 + needs: test + 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 @@ -48,7 +95,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 diff --git a/.goreleaser-fast.yml b/.goreleaser-fast.yml new file mode 100644 index 000000000..b550ef9d4 --- /dev/null +++ b/.goreleaser-fast.yml @@ -0,0 +1,55 @@ +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" + +# Skip changelog - full release will generate it +changelog: + disable: true diff --git a/.goreleaser.yml b/.goreleaser.yml index aa18dca8b..d33ee2718 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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: @@ -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: @@ -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: From d5a35d6b3e2058ad51e5218ac4b2e18755dd527a Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Wed, 17 Dec 2025 15:38:58 +0530 Subject: [PATCH 2/4] fix: add nfpms to fast release for linux/amd64 deb/rpm packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .goreleaser-fast.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.goreleaser-fast.yml b/.goreleaser-fast.yml index b550ef9d4..259ae6c56 100644 --- a/.goreleaser-fast.yml +++ b/.goreleaser-fast.yml @@ -50,6 +50,15 @@ dockers: - "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 From 969a7e6d1a3778a6664ccd0ff71d2c0b240e871d Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Wed, 17 Dec 2025 15:50:03 +0530 Subject: [PATCH 3/4] feat: add test-quick target for faster release pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `make test-quick` without -race and -count 2 flags - Use test-quick in release workflow to save ~2-3 minutes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release.yml | 2 +- Makefile | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7736c068..f97203c02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: with: go-version: "1.23.1" - name: Run tests - run: make test + run: make test-quick dev: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 5812fb459..e88de95a0 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GOVERSION := $(shell go version | cut -d ' ' -f 3 | cut -d '.' -f 2) NAME=github.com/raystack/frontier TAG := $(shell git rev-list --tags --max-count=1) VERSION := $(shell git describe --tags ${TAG}) -.PHONY: build check fmt lint test test-race vet test-cover-html help install proto ui compose-up-dev +.PHONY: build check fmt lint test test-quick test-race vet test-cover-html help install proto ui compose-up-dev .DEFAULT_GOAL := build PROTON_COMMIT := "80fc5ba1e538e38d5ca190386af1e69ee64584ee" @@ -33,6 +33,9 @@ lint-fix: test: ## Run tests @go test -race $(shell go list ./... | grep -v /ui | grep -v /vendor/ | grep -v /test/ | grep -v /mocks | grep -v postgres/migrations | grep -v /proto) -coverprofile=coverage.out -count 2 -timeout 150s +test-quick: ## Run tests without race detector (faster, for release pipeline) + @go test $(shell go list ./... | grep -v /ui | grep -v /vendor/ | grep -v /test/ | grep -v /mocks | grep -v postgres/migrations | grep -v /proto) -timeout 120s + test-all: lint test e2e-test ## Run all tests e2e-test: ## Run all e2e tests From 8bed6fd9893ea678ba14b521e4a8c8015d72378f Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Thu, 18 Dec 2025 10:49:38 +0530 Subject: [PATCH 4/4] refactor: remove test job from release workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests already run on every PR via CI. No need to duplicate in release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release.yml | 16 ---------------- Makefile | 5 +---- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f97203c02..db702f73e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,23 +7,8 @@ on: workflow_dispatch: jobs: - test: - 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: Run tests - run: make test-quick - dev: runs-on: ubuntu-latest - needs: test steps: - name: Checkout code uses: actions/checkout@v3 @@ -51,7 +36,6 @@ jobs: # This finishes first so users don't have to wait release-fast: runs-on: ubuntu-latest - needs: test steps: - name: Checkout uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index e88de95a0..5812fb459 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GOVERSION := $(shell go version | cut -d ' ' -f 3 | cut -d '.' -f 2) NAME=github.com/raystack/frontier TAG := $(shell git rev-list --tags --max-count=1) VERSION := $(shell git describe --tags ${TAG}) -.PHONY: build check fmt lint test test-quick test-race vet test-cover-html help install proto ui compose-up-dev +.PHONY: build check fmt lint test test-race vet test-cover-html help install proto ui compose-up-dev .DEFAULT_GOAL := build PROTON_COMMIT := "80fc5ba1e538e38d5ca190386af1e69ee64584ee" @@ -33,9 +33,6 @@ lint-fix: test: ## Run tests @go test -race $(shell go list ./... | grep -v /ui | grep -v /vendor/ | grep -v /test/ | grep -v /mocks | grep -v postgres/migrations | grep -v /proto) -coverprofile=coverage.out -count 2 -timeout 150s -test-quick: ## Run tests without race detector (faster, for release pipeline) - @go test $(shell go list ./... | grep -v /ui | grep -v /vendor/ | grep -v /test/ | grep -v /mocks | grep -v postgres/migrations | grep -v /proto) -timeout 120s - test-all: lint test e2e-test ## Run all tests e2e-test: ## Run all e2e tests