mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 10:25:32 +00:00
Previously we tried to include all necessary files in the Linux source tarball, so that a user would be able to successfully run the top-level `build.sh` file. However, that causes problems when new dependencies between sub-projects get introduced that would require adding additional sub-projects to the tarball. This change modifies the tarball to only include files that are necessary to run the `linux/build.sh` file, i.e. necessary to build Keyman for Linux. This is likely what users would expect when they download a source tarball for Linux. If users want to build other parts of Keyman that are buildable on Linux they can download the source tarball that the GitHub releases page provides, or clone the repo. In order to be able to still run the top-level `build.sh` script, this change replaces the top-level `build.sh` with a script that simply forwards the arguments to `linux/build.sh`. This change also reverts the recent introduction of a *.pkg.tar.xz file that contained all files necessary to build a Debian/Ubuntu package. There wouldn't be a difference anymore between the two .tar.xz files. Fixes: #16004 Fixes: #16005 Build-bot: skip build:linux Test-bot: skip
155 lines
5.6 KiB
Bash
Executable file
155 lines
5.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# TC build script for Keyman Linux/Release
|
|
# shellcheck disable=SC2164
|
|
|
|
## START STANDARD BUILD SCRIPT INCLUDE
|
|
# adjust relative paths as necessary
|
|
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|
. "${THIS_SCRIPT%/*}/../../../resources/build/builder-full.inc.sh"
|
|
## END STANDARD BUILD SCRIPT INCLUDE
|
|
|
|
# shellcheck disable=SC2154
|
|
. "${KEYMAN_ROOT}/resources/build/utils.inc.sh"
|
|
. "${KEYMAN_ROOT}/resources/teamcity/includes/tc-helpers.inc.sh"
|
|
. "${KEYMAN_ROOT}/resources/teamcity/includes/tc-linux.inc.sh"
|
|
. "${KEYMAN_ROOT}/resources/teamcity/linux/linux-actions.inc.sh"
|
|
|
|
################################ Main script ################################
|
|
|
|
# shellcheck disable=SC2016
|
|
builder_describe \
|
|
"Create a daily release of 'master', 'beta', or 'stable-*' branch." \
|
|
"all run all actions" \
|
|
"configure install dependencies" \
|
|
"build make a release build" \
|
|
"test run unit tests" \
|
|
"publish make a source tarball and publish to downloads and launchpad" \
|
|
"--gpgkey=GPGKEYGRIP GPG key for signing" \
|
|
"--gpgpw=GPGKEYPW GPG key passphrase" \
|
|
"--rsync-path=RSYNC_PATH rsync path on remote server" \
|
|
"--rsync-user=RSYNC_USER rsync user on remote server" \
|
|
"--rsync-host=RSYNC_HOST rsync host on remote server" \
|
|
"--rsync-root=RSYNC_ROOT rsync root on remote server" \
|
|
"--help.keyman.com=HELP_KEYMAN_COM path to help.keyman.com repository" \
|
|
|
|
builder_parse "$@"
|
|
|
|
cd "${KEYMAN_ROOT}/linux"
|
|
|
|
function _install_additional_dependencies() {
|
|
builder_echo start additional_dependencies "Installing additional dependencies"
|
|
|
|
# Additionally we need quilt to be able to create the source package.
|
|
# Since this is not needed to build the binary package, it is not
|
|
# (and should not be) included in `build-depends` in `debian/control`.
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install quilt
|
|
|
|
builder_echo end additional_dependencies success "Finished installing additional dependencies"
|
|
}
|
|
|
|
function _cleanup_before_creating_source_package() {
|
|
# Cleanup before creating the source package.
|
|
builder_echo start cleanup "Cleanup before creating the source package"
|
|
git clean -dxf
|
|
builder_echo end cleanup success "Cleanup before creating the source package"
|
|
}
|
|
|
|
function _make_release_source_tarball() {
|
|
builder_echo start "make source tarball" "Make source tarball"
|
|
rm -rf dist
|
|
mkdir -p "upload/${KEYMAN_VERSION}"
|
|
./scripts/reconf.sh
|
|
PKG_CONFIG_PATH="${KEYMAN_ROOT}/core/build/arch/release/meson-private" ./scripts/dist.sh
|
|
mv dist/*.tar.xz "upload/${KEYMAN_VERSION}/"
|
|
(
|
|
cd "upload/${KEYMAN_VERSION}"
|
|
sha256sum ./*.tar.xz > SHA256SUMS
|
|
)
|
|
builder_echo end "make source tarball" success "Make source tarball"
|
|
}
|
|
|
|
function _sign_source_tarball() {
|
|
(
|
|
builder_echo start "sign source tarball" "Sign source tarball"
|
|
cd "upload/${KEYMAN_VERSION}"
|
|
|
|
eval "$(gpg-agent -vv --daemon --allow-preset-passphrase --debug-level 9)"
|
|
/usr/lib/gnupg/gpg-preset-passphrase --passphrase "${GPGKEYPW}" --preset "${GPGKEYGRIP}"
|
|
for f in ./*.tar.xz; do gpg --output "${f}.asc" -a --detach-sig "${f}"; done
|
|
/usr/lib/gnupg/gpg-preset-passphrase --forget "${GPGKEYGRIP}" || true
|
|
builder_echo end "sign source tarball" success "Sign source tarball"
|
|
)
|
|
}
|
|
|
|
function _publish_to_downloads() {
|
|
builder_echo start "publish to downloads" "Publish to downloads.keyman.com"
|
|
|
|
local UPLOAD_DIR
|
|
|
|
UPLOAD_DIR="upload/${KEYMAN_VERSION}"
|
|
|
|
# Set permissions as required on download site
|
|
builder_echo "Setting upload file permissions for downloads.keyman.com"
|
|
chmod g+w "${UPLOAD_DIR}"
|
|
chmod a+rx "${UPLOAD_DIR}"
|
|
chmod g+w "${UPLOAD_DIR}"/*
|
|
chmod a+r "${UPLOAD_DIR}"/*
|
|
|
|
write_download_info "${UPLOAD_DIR}" "keyman-${KEYMAN_VERSION}.tar.xz" "Keyman for Linux source tarball" tar.xz linux
|
|
tc_rsync_upload "${UPLOAD_DIR}" "linux/${KEYMAN_TIER}"
|
|
|
|
builder_echo end "publish to downloads" success "Publish to downloads.keyman.com"
|
|
}
|
|
|
|
function _publish_to_launchpad() {
|
|
builder_echo start "upload to launchpad" "Upload to launchpad"
|
|
|
|
git reset --hard
|
|
|
|
/usr/lib/gnupg/gpg-preset-passphrase --passphrase "${GPGKEYPW}" --preset "${GPGKEYGRIP}"
|
|
"${KEYMAN_ROOT}/linux/scripts/launchpad.sh" --upload
|
|
/usr/lib/gnupg/gpg-preset-passphrase --forget "${GPGKEYGRIP}" || true
|
|
|
|
builder_echo end "upload to launchpad" success "Upload to launchpad"
|
|
}
|
|
|
|
function _publish_linux_help() {
|
|
builder_echo start "upload linux help" "Upload new Keyman Linux help to help.keyman.com"
|
|
|
|
cd "${HELP_KEYMAN_COM}"
|
|
# shellcheck disable=SC2016
|
|
git config credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${GITHUB_TOKEN}"; }; f'
|
|
cd "${KEYMAN_ROOT}/resources/build"
|
|
"${KEYMAN_ROOT}/resources/build/ci/help-keyman-com.sh" linux
|
|
|
|
builder_echo end "upload linux help" success "Upload new Keyman Linux help to help.keyman.com"
|
|
}
|
|
|
|
function publish_action() {
|
|
_cleanup_before_creating_source_package
|
|
_make_release_source_tarball
|
|
_sign_source_tarball
|
|
_publish_to_downloads
|
|
_publish_to_launchpad
|
|
_publish_linux_help
|
|
}
|
|
|
|
if builder_has_action all; then
|
|
linux_install_dependencies_action
|
|
_install_additional_dependencies
|
|
|
|
tc_set_variables_for_nvm
|
|
|
|
linux_build_action
|
|
linux_unit_tests_action --no-integration
|
|
publish_action
|
|
else
|
|
builder_run_action configure linux_install_dependencies_action
|
|
builder_run_action configure _install_additional_dependencies
|
|
|
|
tc_set_variables_for_nvm
|
|
|
|
builder_run_action build linux_build_action
|
|
builder_run_action test linux_unit_tests_action --no-integration
|
|
builder_run_action publish publish_action
|
|
fi
|