Skip to content

Commit 3fee9a7

Browse files
committed
Split dev release and full release configurations
1 parent b3f9e22 commit 3fee9a7

File tree

3 files changed

+101
-12
lines changed

3 files changed

+101
-12
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
git tag -a "${tag}" -m "${message}"
8080
git push origin "${tag}"
8181
- name: Run GoReleaser
82+
if: github.event.inputs.dev == 'false'
8283
uses: goreleaser/goreleaser-action@v3
8384
with:
8485
version: latest
@@ -88,7 +89,17 @@ jobs:
8889
GO_BOT_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
8990
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
9091
S3_BUCKET_REGION: ${{ secrets.S3_BUCKET_REGION }}
91-
DEV_BUILD: ${{ github.event.inputs.dev }}
92+
- name: Run GoReleaser Dev Build
93+
if: github.event.inputs.dev == 'true'
94+
uses: goreleaser/goreleaser-action@v3
95+
with:
96+
version: latest
97+
args: release --rm-dist --debug --config=".goreleaser-dev.yml"
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
GO_BOT_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
101+
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
102+
S3_BUCKET_REGION: ${{ secrets.S3_BUCKET_REGION }}
92103

93104
notify:
94105
runs-on: ubuntu-latest

.goreleaser-dev.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
project_name: ast-cli
2+
3+
release:
4+
prerelease: true
5+
name_template: 'Checkmarx One CLI {{.Version}}'
6+
7+
builds:
8+
- main: ./cmd/main.go
9+
env:
10+
- CGO_ENABLED=0
11+
binary: cx
12+
id: cx
13+
goos:
14+
- linux
15+
- windows
16+
goarch:
17+
- amd64
18+
- arm
19+
- arm64
20+
ignore:
21+
- goos: darwin
22+
goarch: 386
23+
- goos: linux
24+
goarm: 7
25+
- goos: windows
26+
goarm: 7
27+
- goos: windows
28+
goarch: arm
29+
- goos: windows
30+
goarch: arm64
31+
ldflags:
32+
- -s
33+
- -w
34+
- -X github.com/checkmarx/ast-cli/internal/params.Version={{.Version}}
35+
- main: ./cmd/main.go
36+
env:
37+
- CGO_ENABLED=0
38+
binary: cx
39+
id: cx-mac-universal
40+
goos:
41+
- darwin
42+
goarch:
43+
- amd64
44+
- arm
45+
- arm64
46+
ldflags:
47+
- -s
48+
- -w
49+
- -X github.com/checkmarx/ast-cli/internal/params.Version={{.Version}}
50+
51+
archives:
52+
- id: cx
53+
builds:
54+
- cx
55+
format_overrides:
56+
- goos: windows
57+
format: zip
58+
replacements:
59+
amd64: x64
60+
386: x32
61+
files:
62+
- LICENSE
63+
- id: cx-mac-universal
64+
builds:
65+
- cx-mac-universal
66+
files:
67+
- LICENSE
68+
- ./dist/cx-mac-universal_darwin_all/cx.dmg
69+
name_template: "{{ .ProjectName }}_{{ .Version }}_darwin_x64"
70+
71+
universal_binaries:
72+
- id: cx-mac-universal
73+
replace: true
74+
name_template: "cx"
75+
hooks:
76+
post: gon gonMac.hcl
77+
78+
blobs:
79+
- provider: s3
80+
region: "{{ .Env.S3_BUCKET_REGION }}"
81+
bucket: "{{ .Env.S3_BUCKET_NAME }}"
82+
folder: "CxOne/CLI/{{ .Tag }}"
83+
ids:
84+
- cx
85+
- cx-mac-universal
86+
87+
changelog:
88+
use: github-native

.goreleaser.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
project_name: ast-cli
22

33
release:
4-
prerelease: '{{- eq .Env.DEV_BUILD "true" }}'
5-
name_template: 'Checkmarx One CLI {{- if eq .Env.DEV_BUILD "true" }} Dev{{- end }} {{.Version}}'
4+
name_template: 'Checkmarx One CLI {{.Version}}'
65

76
builds:
87
- main: ./cmd/main.go
@@ -51,18 +50,11 @@ builds:
5150
dockers:
5251
- use: docker
5352
dockerfile: Dockerfile
54-
skip_push: true
5553
image_templates:
5654
- "cxsdlc/ast-cli:latest"
5755
- "cxsdlc/ast-cli:{{ .Tag }}"
5856
- "checkmarx/ast-cli:latest"
5957
- "checkmarx/ast-cli:{{ .Tag }}"
60-
- use: docker
61-
dockerfile: Dockerfile
62-
skip_push: true
63-
image_templates:
64-
- "cxsdlc/ast-cli-dev:{{ .Tag }}"
65-
- "checkmarx/ast-cli-dev:{{ .Tag }}"
6658

6759
archives:
6860
- id: cx
@@ -115,7 +107,6 @@ brews:
115107
owner: checkmarx
116108
name: homebrew-ast-cli
117109
token: "{{ .Env.GO_BOT_TOKEN }}"
118-
skip_upload: '{{- eq .Env.DEV_BUILD "true" }}'
119110
ids:
120111
- cx
121112
- cx-mac-universal
@@ -146,7 +137,6 @@ blobs:
146137
- cx
147138
- cx-mac-universal
148139
- provider: s3
149-
disable: '{{- eq .Env.DEV_BUILD "true" }}'
150140
region: "{{ .Env.S3_BUCKET_REGION }}"
151141
bucket: "{{ .Env.S3_BUCKET_NAME }}"
152142
folder: "CxOne/CLI/latest"

0 commit comments

Comments
 (0)