Skip to content

Commit d593bfd

Browse files
committed
deb: sign package and set version
1 parent 77a92d7 commit d593bfd

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

.goreleaser.pkg.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

GNUmakefile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ rpm-build: srpm-build
2323
cd ~/rpmbuild/
2424
rpmbuild -bs
2525

26-
template-deb:
26+
template-deb-setup:
27+
apt install curl jq -y
28+
29+
template-deb: template-deb-setup require-version
2730
RELEASE_JSON="$$(curl https://api.github.com/repos/scaleway/scaleway-cli/releases/tags/v${VERSION})"; \
2831
CHANGELOG="$$(echo $${RELEASE_JSON} | jq ."body" -r | grep '^*' | sed s/^\*/\ \ \*/g)"; \
2932
DATE=$$(date -d "$$(echo $${RELEASE_JSON} | jq ."created_at" -r)" -R) ; \
@@ -32,13 +35,23 @@ template-deb:
3235
echo -e "\n -- Scaleway Devtools <opensource@scaleway.com> $${DATE}" >> specs/deb/changelog
3336

3437
deb-setup:
35-
apt install devscripts equivs jq -y
38+
apt install devscripts equivs -y
3639
ln -fs specs/deb debian
3740
mk-build-deps --install debian/control -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y"
3841
go mod vendor
3942

40-
deb-source-build: template-deb deb-setup
41-
debuild -S -k524A68BAB1A91B2F74DCEC3B31F9FBCA5BD8707C
43+
deb-source-build: require-version template-deb deb-setup
44+
debuild -S -us -uc
45+
46+
deb-source-sign: require-version
47+
echo '$(value GPG_PASSPHRASE)' > /tmp/key
48+
debsign -k524A68BAB1A91B2F74DCEC3B31F9FBCA5BD8707C --re-sign -p"gpg --pinentry-mode=loopback --passphrase-file /tmp/key" ../scw_${VERSION}.dsc ../scw_${VERSION}_source.changes
49+
rm /tmp/key
50+
51+
deb-source: deb-source-build deb-source-sign
52+
53+
deb-build:
54+
debuild -b -us -uc
4255

4356
require-version:
4457
ifndef VERSION

specs/deb/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Package: scw
1010
Architecture: all
1111
Description: Scaleway CLI
1212
XS-Go-Import-Path: github.com/scaleway/scaleway-cli/v2/cmd/scw
13+
Version: ${VERSION}

specs/deb/rules

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
export DH_GOPKG := github.com/scaleway/scaleway-cli/v2
44
export DH_GOLANG_BUILDPKG := ${DH_GOPKG}/cmd/scw
55

6+
VERSION := $(shell dpkg-parsechangelog -SVersion)
7+
68
%:
79
dh $@ --builddirectory=_build
810

911
override_dh_auto_install:
10-
dh_auto_install -- --no-source
12+
dh_auto_install -- --no-source
13+
14+
override_dh_auto_build:
15+
dh_auto_build -- -ldflags "-w -extldflags -static -X main.Version=${VERSION}"

0 commit comments

Comments
 (0)