Skip to content

Commit

Permalink
fix: update goreleaser config and add build ci job to make sure gorel…
Browse files Browse the repository at this point in the history
…easer works
  • Loading branch information
floreks committed Feb 22, 2024
1 parent 0be7c40 commit 8709707
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 26 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,59 @@ jobs:
uses: golangci/golangci-lint-action@v4
with:
version: v1.54.2
build:
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 SHA variable
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Setup Cache
uses: actions/[email protected]
with:
path: dist/${{ matrix.goos }}
key: ${{ matrix.goos }}-${{ env.sha_short }}
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: GoReleaser (Build)
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser-pro
version: latest
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 }}
52 changes: 26 additions & 26 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ builds:
- linux_amd64
- linux_arm64
- windows_amd64
# TODO: Re-enable once fixed
# Ref: https://github.com/golang/go/issues/51019
# - windows_arm64
# TODO: Re-enable once fixed
# Ref: https://github.com/golang/go/issues/51019
# - windows_arm64
- darwin_amd64
- darwin_arm64
env:
- CGO_ENABLED=1
- CGO_ENABLED=0
ldflags:
- -s
- -w
Expand All @@ -43,21 +43,21 @@ builds:
env:
- CGO_ENABLED=0
# Build CLI binary without embedded UI for linux.
- id: plural-cli-console
targets:
- linux_amd64
- linux_arm64
ldflags:
- -s
- -w
- -X "github.com/pluralsh/plural-cli/cmd/plural.Version={{.Version}}"
- -X "github.com/pluralsh/plural-cli/cmd/plural.Commit={{.Commit}}"
- -X "github.com/pluralsh/plural-cli/cmd/plural.Date={{.Date}}"
- -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
tags: [ linux ]
env:
- CGO_ENABLED=0
binary: plural
# - id: plural-cli-console
# targets:
# - linux_amd64
# - linux_arm64
# ldflags:
# - -s
# - -w
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Version={{.Version}}"
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Commit={{.Commit}}"
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Date={{.Date}}"
# - -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
# tags: [ linux ]
# env:
# - CGO_ENABLED=0
# binary: plural

archives:
- id: plural-cli
Expand All @@ -67,13 +67,13 @@ archives:
{{- title .Os }}_
{{- if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
- id: plural-cli-console
builds: [ plural-cli-console ]
name_template: >-
{{ .ProjectName }}_console_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
# - id: plural-cli-console
# builds: [ plural-cli-console ]
# name_template: >-
# {{ .ProjectName }}_console_{{ .Version }}_
# {{- title .Os }}_
# {{- if eq .Arch "386" }}i386
# {{- else }}{{ .Arch }}{{ end }}

checksum:
name_template: 'checksums.txt'
Expand Down

0 comments on commit 8709707

Please sign in to comment.