Skip to content

Commit 146e886

Browse files
authored
Merge pull request cli#12318 from cli/babakks/upgrade-to-goreleaser-v2
ci: upgrade to GoReleaser `v2`
2 parents b3aae1f + 045afa4 commit 146e886

4 files changed

Lines changed: 28 additions & 22 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ jobs:
5050
with:
5151
go-version-file: 'go.mod'
5252
- name: Install GoReleaser
53-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
53+
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
5454
with:
55-
version: "~1.17.1"
55+
# The version is pinned not only for security purposes, but also to avoid breaking
56+
# our scripts, which rely on the specific file names generated by GoReleaser.
57+
version: v2.13.1
5658
install-only: true
5759
- name: Build release binaries
5860
env:
@@ -103,9 +105,11 @@ jobs:
103105
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k "$keychain_password" "$keychain"
104106
rm "$RUNNER_TEMP/cert.p12"
105107
- name: Install GoReleaser
106-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
108+
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
107109
with:
108-
version: "~1.17.1"
110+
# The version is pinned not only for security purposes, but also to avoid breaking
111+
# our scripts, which rely on the specific file names generated by GoReleaser.
112+
version: v2.13.1
109113
install-only: true
110114
- name: Build release binaries
111115
env:
@@ -157,9 +161,11 @@ jobs:
157161
with:
158162
go-version-file: 'go.mod'
159163
- name: Install GoReleaser
160-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
164+
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
161165
with:
162-
version: "~1.17.1"
166+
# The version is pinned not only for security purposes, but also to avoid breaking
167+
# our scripts, which rely on the specific file names generated by GoReleaser.
168+
version: v2.13.1
163169
install-only: true
164170
- name: Install Azure Code Signing Client
165171
shell: pwsh
@@ -207,15 +213,15 @@ jobs:
207213
MSI_VERSION="$(cut -d_ -f2 <<<"$MSI_NAME" | cut -d- -f1)"
208214
case "$MSI_NAME" in
209215
*_386 )
210-
source_dir="$PWD/dist/windows_windows_386"
216+
source_dir="$PWD/dist/windows_windows_386_sse2"
211217
platform="x86"
212218
;;
213219
*_amd64 )
214220
source_dir="$PWD/dist/windows_windows_amd64_v1"
215221
platform="x64"
216222
;;
217223
*_arm64 )
218-
source_dir="$PWD/dist/windows_windows_arm64"
224+
source_dir="$PWD/dist/windows_windows_arm64_v8.0"
219225
platform="arm64"
220226
;;
221227
* )

.goreleaser.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: 2
2+
13
project_name: gh
24

35
release:
@@ -28,7 +30,7 @@ builds:
2830

2931
- id: linux #build:linux
3032
goos: [linux]
31-
goarch: [386, arm, amd64, arm64]
33+
goarch: ["386", arm, amd64, arm64]
3234
env:
3335
- CGO_ENABLED=0
3436
binary: bin/gh
@@ -38,7 +40,7 @@ builds:
3840

3941
- id: windows #build:windows
4042
goos: [windows]
41-
goarch: [386, amd64, arm64]
43+
goarch: ["386", amd64, arm64]
4244
hooks:
4345
post:
4446
- cmd: pwsh .\script\sign.ps1 '{{ .Path }}'
@@ -50,34 +52,32 @@ builds:
5052

5153
archives:
5254
- id: linux-archive
53-
builds: [linux]
55+
ids: [linux]
5456
name_template: "gh_{{ .Version }}_linux_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
5557
wrap_in_directory: true
56-
format: tar.gz
57-
rlcp: true
58+
formats: [tar.gz]
5859
files:
5960
- LICENSE
6061
- ./share/man/man1/gh*.1
6162
- id: macos-archive
62-
builds: [macos]
63+
ids: [macos]
6364
name_template: "gh_{{ .Version }}_macOS_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
6465
wrap_in_directory: true
65-
format: zip
66-
rlcp: true
66+
formats: [zip]
6767
files:
6868
- LICENSE
6969
- ./share/man/man1/gh*.1
7070
- id: windows-archive
71-
builds: [windows]
71+
ids: [windows]
7272
name_template: "gh_{{ .Version }}_windows_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
7373
wrap_in_directory: false
74-
format: zip
75-
rlcp: true
74+
formats: [zip]
7675
files:
7776
- LICENSE
7877

7978
nfpms: #build:linux
80-
- license: MIT
79+
- ids: [linux]
80+
license: MIT
8181
maintainer: GitHub
8282
homepage: https://github.com/cli/cli
8383
bindir: /usr

script/pkgmacos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fi
5858

5959
# gh-binary paths
6060
bin_path="/bin/gh"
61-
arm64_bin="./dist/macos_darwin_arm64$bin_path"
61+
arm64_bin="./dist/macos_darwin_arm64_v8.0$bin_path"
6262
amd64_bin="./dist/macos_darwin_amd64_v1$bin_path"
6363
# payload paths
6464
payload_root="pkg_payload"

script/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ build_local() {
9494
;;
9595
esac
9696
[ -z "$tag_name" ] || export GORELEASER_CURRENT_TAG="$tag_name"
97-
announce goreleaser release -f "$goreleaser_config" --clean --skip-validate --skip-publish --release-notes="$(mktemp)"
97+
announce goreleaser release -f "$goreleaser_config" --clean --skip validate,publish,announce --release-notes="$(mktemp)"
9898
}
9999

100100
if [ -n "$is_local" ]; then

0 commit comments

Comments
 (0)