-
Notifications
You must be signed in to change notification settings - Fork 851
[ci] Refactor RPM nfpm configs for reuse #5179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6387fa4
0b641f8
28e9a97
e621435
df3e925
7cedfee
58c40cc
97eaee3
d3df3a2
7be532d
6b113b7
f472dc1
ea91494
639eec8
8e4cd35
06c5833
0e1d908
234e92c
03825b1
dd5ec2a
9595da4
c821157
70927aa
49e9695
a2cb5f6
6f03745
361456f
50dc30c
cdc384f
6ebb19e
ef8bd3f
9836e68
4ea5591
0d1e1aa
052a9c5
e0ce137
3a4607f
c85716d
74c67a4
bd1320f
ef16400
a939959
5f653ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Build and sign a Linux package inside the container. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| : "${PACKAGE:?PACKAGE must be set (avalanchego or subnet-evm)}" | ||
| : "${VERSION:?VERSION must be set (semver without v prefix, e.g. 1.14.1)}" | ||
| : "${TAG:?TAG must be set (git tag, e.g. v1.14.1)}" | ||
| : "${PACKAGE_ARCH:?PACKAGE_ARCH must be set (x86_64 or aarch64)}" | ||
| : "${OUTPUT_DIR:?OUTPUT_DIR must be set (bind-mounted output dir)}" | ||
|
|
||
| : "${PKG_FORMAT:?PKG_FORMAT must be set (RPM or DEB)}" | ||
| pkg_format_lower="${PKG_FORMAT,,}" | ||
|
|
||
| REPO_ROOT="/build" | ||
| PACKAGING_DIR="${REPO_ROOT}/.github/packaging" | ||
|
|
||
| # shellcheck disable=SC1091 | ||
| source "${PACKAGING_DIR}/scripts/lib-build-common.sh" | ||
|
|
||
| # Well-known paths referenced by nfpm configs | ||
| export NFPM_CHANGELOG="${REPO_ROOT}/build/nfpm-changelog.yml" | ||
| export NFPM_SIGNING_KEY="${REPO_ROOT}/build/gpg/signing-key.asc" | ||
|
|
||
| echo "=== Building ${PACKAGE} ${PKG_FORMAT} for ${PACKAGE_ARCH} (tag: ${TAG}) ===" | ||
|
|
||
| init_build_env | ||
| build_binary "${PACKAGE}" | ||
| generate_changelog "${VERSION}" | ||
|
|
||
| # ── GPG signing ─────────────────────────────────────────────────── | ||
|
|
||
| GPG_KEY_FILE="${GPG_KEY_FILE:-}" | ||
| GPG_PUBLIC_KEY="${OUTPUT_DIR}/GPG-KEY-avalanchego" | ||
|
|
||
| # nfpm reads the signing passphrase from a packager-specific env var | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (No action required) With the switch to signing DEBs with nfpm, some of the extractions this script to |
||
| # (NFPM_RPM_PASSPHRASE, NFPM_DEB_PASSPHRASE, ...); mirror our format- | ||
| # agnostic GPG_KEY_PASSPHRASE into the name nfpm expects. | ||
| nfpm_passphrase_var="NFPM_${PKG_FORMAT}_PASSPHRASE" | ||
| export "${nfpm_passphrase_var}=${GPG_KEY_PASSPHRASE:-}" | ||
|
|
||
| # Ephemeral keys use a known throwaway passphrase so local and CI builds | ||
| # exercise passphrase handling without release credentials. | ||
| if [[ -z "${GPG_KEY_FILE}" ]]; then | ||
| use_ephemeral_gpg_passphrase "${nfpm_passphrase_var}" | ||
| fi | ||
|
|
||
| setup_gpg "${GPG_KEY_FILE}" "${GPG_PUBLIC_KEY}" "${PKG_FORMAT}" | ||
|
|
||
| # ── Package with nfpm ───────────────────────────────────────────── | ||
|
|
||
| export VERSION PACKAGE_ARCH BINARY_PATH | ||
|
|
||
| PKG_FILENAME="${PACKAGE}-${TAG}-${PACKAGE_ARCH}.${pkg_format_lower}" | ||
| PKG_PATH="${OUTPUT_DIR}/${PKG_FILENAME}" | ||
|
|
||
| run_nfpm_package \ | ||
| "${PACKAGING_DIR}/nfpm/${PACKAGE}-${pkg_format_lower}.yml" \ | ||
| "${REPO_ROOT}/build/${PACKAGE}-${pkg_format_lower}-resolved.yml" \ | ||
| "${pkg_format_lower}" \ | ||
| "${PKG_PATH}" | ||
|
|
||
| echo "${PKG_FORMAT} built: ${PKG_PATH}" | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.