|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | # |
3 | | -# This script expects to run on Ubuntu. It installs the dependencies necessary |
4 | | -# to build Boulder and produce a Debian Package. The actual build and packaging |
5 | | -# is handled by a call to Make. |
| 3 | +# Build Boulder and produce a .deb and a .tar.gz. |
| 4 | +# |
| 5 | +# This script expects to run on Ubuntu, as configured on GitHub Actions runners |
| 6 | +# (with curl, make, and git installed). |
6 | 7 | # |
7 | | - |
8 | 8 | # -e Stops execution in the instance of a command or pipeline error. |
9 | 9 | # -u Treat unset variables as an error and exit immediately. |
10 | 10 | set -eu |
11 | 11 |
|
12 | | -# |
13 | | -# Setup Dependencies |
14 | | -# |
15 | | - |
16 | | -sudo apt-get install -y --no-install-recommends \ |
17 | | - ruby \ |
18 | | - ruby-dev \ |
19 | | - gcc |
| 12 | +ARCH="$(uname -m)" |
| 13 | +if [ "${ARCH}" != "x86_64" && "${ARCH}" != "amd64" ]; then |
| 14 | + echo "Expected ARCH=x86_64 or amd64, got ${ARCH}" |
| 15 | + exit 1 |
| 16 | +fi |
20 | 17 |
|
21 | 18 | # Download and unpack our production go version. Ensure that $GO_VERSION is |
22 | 19 | # already set in the environment (e.g. by the github actions release workflow). |
23 | 20 | $(dirname -- "${0}")/fetch-and-verify-go.sh "${GO_VERSION}" |
24 | 21 | sudo tar -C /usr/local -xzf go.tar.gz |
25 | 22 | export PATH=/usr/local/go/bin:$PATH |
26 | 23 |
|
27 | | -# Install fpm. This is used in our Makefile to package Boulder as a deb. |
28 | | -# We install specific versions of some dependencies because these are the last versions |
29 | | -# supported by the Ruby / RubyGems that ships on ubuntu-20.04, which this script runs on in CI. |
30 | | -sudo gem install --no-document -v 1.8.0 rchardet |
31 | | -sudo gem install --no-document -v 5.1.1 public_suffix |
32 | | -sudo gem install --no-document -v 2.8.1 dotenv |
33 | | -sudo gem install --no-document -v 1.14.0 fpm |
34 | | - |
35 | 24 | # |
36 | 25 | # Build |
37 | 26 | # |
38 | 27 |
|
39 | | -# Set $ARCHIVEDIR to our current directory. If left unset our Makefile will set |
40 | | -# it to /tmp. |
41 | | -export ARCHIVEDIR="${PWD}" |
42 | | - |
43 | 28 | # Set $VERSION to be a simulacrum of what is set in other build environments. |
44 | | -export VERSION="${GO_VERSION}.$(date +%s)" |
| 29 | +VERSION="${GO_VERSION}.$(date +%s)" |
45 | 30 |
|
46 | 31 | # Build Boulder. |
47 | 32 | make |
48 | 33 |
|
49 | | -# Produce a .deb and a tar.gz file in $PWD. |
50 | | -make deb tar |
51 | | - |
52 | 34 | # Produce a .deb and .tar.gz in $PWD without using `make` or `fpm`. The |
53 | 35 | # resulting files will be named `boulder-newpkg-*`. Eventually this code |
54 | 36 | # will be used to produce the regular `boulder-*` packages. |
@@ -77,13 +59,13 @@ Package: boulder |
77 | 59 | Version: 1:${VERSION} |
78 | 60 | License: Mozilla Public License v2.0 |
79 | 61 | Vendor: ISRG |
80 | | -Architecture: arm64 |
| 62 | +Architecture: amd64 |
81 | 63 | Maintainer: Community |
82 | 64 | Section: default |
83 | 65 | Priority: extra |
84 | 66 | Homepage: https://github.com/letsencrypt/boulder |
85 | 67 | Description: Boulder is an ACME-compatible X.509 Certificate Authority |
86 | 68 | EOF |
87 | 69 |
|
88 | | -dpkg-deb -Zgzip -b "${BUILD}" "${ARCHIVEDIR}/boulder-newpkg-${VERSION}-${COMMIT_ID}.x86_64.deb" |
89 | | -tar -C "${TARGET}" -cpzf "${ARCHIVEDIR}/boulder-newpkg-${VERSION}-${COMMIT_ID}.amd64.tar.gz" . |
| 70 | +dpkg-deb -Zgzip -b "${BUILD}" "./boulder-${VERSION}-${COMMIT_ID}.x86_64.deb" |
| 71 | +tar -C "${TARGET}" -cpzf "./boulder-${VERSION}-${COMMIT_ID}.amd64.tar.gz" . |
0 commit comments