Skip to content

Commit

Permalink
disable goreleaser split build and use single CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
floreks committed Oct 3, 2024
1 parent 36bff3c commit ee97eba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 96 deletions.
86 changes: 1 addition & 85 deletions .github/workflows/goreleaser-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,9 @@ on:
- 'v*.*.*'

jobs:
# Build binaries with GoReleaser
prepare:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
goos: linux
- os: macos-latest
goos: darwin
- os: windows-latest
goos: windows
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.18.1
- name: Setup Cache
uses: actions/[email protected]
with:
path: dist/${{ matrix.goos }}
key: ${{ matrix.goos }}-${{ github.ref_name }}
enableCrossOsArchive: true
- name: Install Dependencies
if: matrix.goos == 'linux'
shell: bash
run: |
sudo apt update
sudo apt install -y libwebkit2gtk-4.0-dev libgtk-3-dev
- name: Build web
shell: bash
run: make build-web
- name: Get Previous Tag
id: prev
uses: WyriHaximus/github-action-get-previous-tag@v1
env:
INPUT_PREFIX: v
- name: GoReleaser (Build)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: '~> v2'
args: release --clean --split --timeout 90m
env:
CGO_LDFLAGS: "${{ matrix.goos == 'darwin' && '-framework UniformTypeIdentifiers' || '' }}"
GOOS: ${{ matrix.GOOS }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_CLIENT_SECRET: ${{ secrets.GITLAB_CLIENT_SECRET }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
GORELEASER_PREVIOUS_TAG: ${{ steps.release.outputs.prev }}

# Release binaries with GoReleaser
release:
runs-on: ubuntu-latest
needs: prepare
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
permissions:
Expand All @@ -84,26 +21,6 @@ jobs:
- uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Copy Cache From Previous Job
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Restore Linux Cache
uses: actions/[email protected]
with:
path: dist/linux
key: linux-${{ github.ref_name }}
- name: Restore Darwin Cache
uses: actions/[email protected]
with:
path: dist/darwin
key: darwin-${{ github.ref_name }}
- name: Restore Windows Cache
uses: actions/[email protected]
with:
path: dist/windows
key: windows-${{ github.ref_name }}
enableCrossOsArchive: true
- name: Get Previous Tag
id: prev
uses: WyriHaximus/github-action-get-previous-tag@v1
Expand All @@ -113,11 +30,10 @@ jobs:
uses: sigstore/[email protected]
- name: GoReleaser (Release)
uses: goreleaser/goreleaser-action@v6
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
with:
distribution: goreleaser-pro
version: '~> v2'
args: continue --merge --timeout 90m
args: release --clean --timeout 90m
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 2 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# Requires a GoReleaser Pro to run
partial:
by: goos

version: 2

before:
Expand All @@ -18,9 +14,7 @@ builds:
- linux_amd64
- linux_arm64
- windows_amd64
# TODO: Re-enable once fixed
# Ref: https://github.com/golang/go/issues/51019
# - windows_arm64
- windows_arm64
- darwin_amd64
- darwin_arm64
env:
Expand All @@ -39,9 +33,7 @@ builds:
- linux_amd64
- linux_arm64
- windows_amd64
# TODO: Re-enable once fixed
# Ref: https://github.com/golang/go/issues/51019
# - windows_arm64
- windows_arm64
- darwin_amd64
- darwin_arm64
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ release:

.PHONY: goreleaser
goreleaser:
goreleaser release --clean --prepare --single-target --snapshot --verbose
goreleaser release --clean --prepare --snapshot

.PHONY: setup
setup: ## sets up your local env (for mac only)
Expand Down

0 comments on commit ee97eba

Please sign in to comment.