Skip to content

Commit fd26257

Browse files
committed
ci: use binary nfpm releases
This removes the need to care about the installed Go version. Presently trying to build `nfpm@latest` from source fails because 2.42+ requires Go 1.23+ and we have Go 1.22 in the packager images. Rather than pin to 2.41 let's install the upstream rpm/deb since it's faster.
1 parent c69260e commit fd26257

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/libssl.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: '15 12 * * *'
1212

13+
env:
14+
nfpm_version: '2.42.0'
15+
1316
jobs:
1417
build:
1518
name: Build+test
@@ -187,8 +190,8 @@ jobs:
187190

188191
- name: Install nfpm
189192
run: |
190-
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
191-
echo PATH=$PATH:$HOME/go/bin >> $GITHUB_ENV
193+
curl -L -O https://github.com/goreleaser/nfpm/releases/download/v${{ env.nfpm_version }}/nfpm_${{ env.nfpm_version }}_amd64.deb
194+
sudo dpkg -i nfpm_${{ env.nfpm_version }}_amd64.deb
192195
193196
- name: Build packages
194197
run: make package PROFILE=release
@@ -209,9 +212,6 @@ jobs:
209212
- container: ubuntu
210213
version: 24.04
211214
package: deb
212-
# nb. ubuntu:22.04 has a too-old golang to build nfpm
213-
# we could install an upstream golang if we want to
214-
# package there.
215215

216216
steps:
217217
- name: Install prerequisites (apt)
@@ -241,18 +241,20 @@ jobs:
241241
apt-get update
242242
apt-get install -y openssl libssl3 libssl-dev lld golang-go
243243
cargo install cargo-get
244-
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
244+
curl -L -O https://github.com/goreleaser/nfpm/releases/download/v${{ env.nfpm_version }}/nfpm_${{ env.nfpm_version }}_amd64.deb
245+
dpkg -i nfpm_${{ env.nfpm_version }}_amd64.deb
245246
246247
- name: Install build dependencies (yum)
247248
if: matrix.package == 'rpm'
248249
run: |
249250
yum install -y openssl openssl-devel lld go
250251
cargo install cargo-get
251-
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
252+
curl -L -O https://github.com/goreleaser/nfpm/releases/download/v${{ env.nfpm_version }}/nfpm-${{ env.nfpm_version }}-1.x86_64.rpm
253+
rpm -ivh ./nfpm-${{ env.nfpm_version }}-1.x86_64.rpm
252254
253255
- name: Build package
254256
run: |
255-
make package-${{ matrix.package }} PROFILE=release NFPM=$HOME/go/bin/nfpm
257+
make package-${{ matrix.package }} PROFILE=release
256258
257259
- name: Archive package
258260
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)