Skip to content

Commit 677ff11

Browse files
authored
Go releaser config support draft mode (#217)
* Go releaser config support draft mode * Update shared-go-auto-release.yml * Update goreleaser.yml
1 parent 5f0012c commit 677ff11

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/goreleaser.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,25 @@ builds:
1717
ldflags:
1818
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
1919
goos:
20+
{{ if and (index .Env "GO_RELEASER_DRAFT_MODE") (.Env.GO_RELEASER_TARGET_COMMITISH == "true") }}
21+
- linux
22+
- darwin
23+
{{ else }}
2024
- freebsd
2125
- windows
2226
- linux
2327
- darwin
28+
{{ end }}
2429
goarch:
30+
{{ if and (index .Env "GO_RELEASER_DRAFT_MODE") (.Env.GO_RELEASER_TARGET_COMMITISH == "true") }}
31+
- amd64
32+
- arm64
33+
{{ else }}
2534
- amd64
2635
- '386'
2736
- arm
2837
- arm64
38+
{{ end }}
2939
binary: '{{ .ProjectName }}'
3040

3141
archives:

.github/workflows/shared-go-auto-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ jobs:
232232
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
233233
GITHUB_TOKEN: ${{ steps.github-app.outputs.token }}
234234
GO_RELEASER_TARGET_COMMITISH: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
235+
GO_RELEASER_DRAFT_MODE: ${{ inputs.draft }}
235236

236237
- name: Check disk space after
237238
if: success() || failure()

0 commit comments

Comments
 (0)