Skip to content

Commit 5ff4f46

Browse files
authored
fix: update goreleaser config and add build ci job (#496)
* fix: update goreleaser config and add build ci job to make sure goreleaser works * update job name and remove web build * update golangci-lint and fix cloud dockerfile
1 parent 0be7c40 commit 5ff4f46

5 files changed

Lines changed: 83 additions & 31 deletions

File tree

.dockerignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ plural.lock
88
.golangci.yml
99
docker-compose.yml
1010
*.md
11-
plural.lock
12-
Pluralfile
1311
renovate.json
1412
packer/
1513
hack/
1614
Makefile
1715
Dockerfile
1816
dockerfiles
19-
!dockerfiles/dind-config
17+
!dockerfiles/dind-config

.github/workflows/ci.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,57 @@ jobs:
397397
uses: golangci/golangci-lint-action@v4
398398
with:
399399
version: v1.54.2
400+
build:
401+
name: GoReleaser build
402+
strategy:
403+
matrix:
404+
os: [ ubuntu-latest, macos-latest, windows-latest ]
405+
include:
406+
- os: ubuntu-latest
407+
goos: linux
408+
- os: macos-latest
409+
goos: darwin
410+
- os: windows-latest
411+
goos: windows
412+
runs-on: ${{ matrix.os }}
413+
steps:
414+
- name: Checkout
415+
uses: actions/checkout@v3
416+
with:
417+
fetch-depth: 0
418+
- name: Setup Go
419+
uses: actions/setup-go@v4.1.0
420+
with:
421+
go-version-file: go.mod
422+
- name: Setup Node
423+
uses: actions/setup-node@v3
424+
with:
425+
node-version: 16.18.1
426+
- name: Setup SHA variable
427+
shell: bash
428+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
429+
- name: Setup Cache
430+
uses: actions/cache@v3.2.3
431+
with:
432+
path: dist/${{ matrix.goos }}
433+
key: ${{ matrix.goos }}-${{ env.sha_short }}
434+
enableCrossOsArchive: true
435+
- name: Install Dependencies
436+
if: matrix.goos == 'linux'
437+
shell: bash
438+
run: |
439+
sudo apt update
440+
sudo apt install -y libwebkit2gtk-4.0-dev libgtk-3-dev
441+
- name: GoReleaser (Build)
442+
uses: goreleaser/goreleaser-action@v4
443+
with:
444+
distribution: goreleaser-pro
445+
version: latest
446+
args: release --clean --split --timeout 90m
447+
env:
448+
CGO_LDFLAGS: "${{ matrix.goos == 'darwin' && '-framework UniformTypeIdentifiers' || '' }}"
449+
GOOS: ${{ matrix.GOOS }}
450+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
451+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
452+
GITLAB_CLIENT_SECRET: ${{ secrets.GITLAB_CLIENT_SECRET }}
453+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ builds:
1515
- linux_amd64
1616
- linux_arm64
1717
- windows_amd64
18-
# TODO: Re-enable once fixed
19-
# Ref: https://github.com/golang/go/issues/51019
20-
# - windows_arm64
18+
# TODO: Re-enable once fixed
19+
# Ref: https://github.com/golang/go/issues/51019
20+
# - windows_arm64
2121
- darwin_amd64
2222
- darwin_arm64
2323
env:
24-
- CGO_ENABLED=1
24+
- CGO_ENABLED=0
2525
ldflags:
2626
- -s
2727
- -w
@@ -43,21 +43,21 @@ builds:
4343
env:
4444
- CGO_ENABLED=0
4545
# Build CLI binary without embedded UI for linux.
46-
- id: plural-cli-console
47-
targets:
48-
- linux_amd64
49-
- linux_arm64
50-
ldflags:
51-
- -s
52-
- -w
53-
- -X "github.com/pluralsh/plural-cli/cmd/plural.Version={{.Version}}"
54-
- -X "github.com/pluralsh/plural-cli/cmd/plural.Commit={{.Commit}}"
55-
- -X "github.com/pluralsh/plural-cli/cmd/plural.Date={{.Date}}"
56-
- -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
57-
tags: [ linux ]
58-
env:
59-
- CGO_ENABLED=0
60-
binary: plural
46+
# - id: plural-cli-console
47+
# targets:
48+
# - linux_amd64
49+
# - linux_arm64
50+
# ldflags:
51+
# - -s
52+
# - -w
53+
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Version={{.Version}}"
54+
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Commit={{.Commit}}"
55+
# - -X "github.com/pluralsh/plural-cli/cmd/plural.Date={{.Date}}"
56+
# - -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
57+
# tags: [ linux ]
58+
# env:
59+
# - CGO_ENABLED=0
60+
# binary: plural
6161

6262
archives:
6363
- id: plural-cli
@@ -67,13 +67,13 @@ archives:
6767
{{- title .Os }}_
6868
{{- if eq .Arch "386" }}i386
6969
{{- else }}{{ .Arch }}{{ end }}
70-
- id: plural-cli-console
71-
builds: [ plural-cli-console ]
72-
name_template: >-
73-
{{ .ProjectName }}_console_{{ .Version }}_
74-
{{- title .Os }}_
75-
{{- if eq .Arch "386" }}i386
76-
{{- else }}{{ .Arch }}{{ end }}
70+
# - id: plural-cli-console
71+
# builds: [ plural-cli-console ]
72+
# name_template: >-
73+
# {{ .ProjectName }}_console_{{ .Version }}_
74+
# {{- title .Os }}_
75+
# {{- if eq .Arch "386" }}i386
76+
# {{- else }}{{ .Arch }}{{ end }}
7777

7878
checksum:
7979
name_template: 'checksums.txt'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ genmock: # generates mocks before running tests
171171

172172
.PHONY: lint
173173
lint:
174-
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.54.2 golangci-lint run
174+
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.56.2 golangci-lint run
175175

176176
.PHONY: delete-tag
177177
delete-tag:

dockerfiles/Dockerfile.cloud

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-alpine3.17 AS builder
1+
FROM golang:1.22-alpine3.19 AS builder
22

33
WORKDIR /workspace
44

0 commit comments

Comments
 (0)