mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
Merge branch 'master' into test/staging-i18n-url-scheme
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
This commit is contained in:
commit
c726c574de
13 changed files with 366 additions and 108 deletions
90
.github/workflows/deb-packaging.yml
vendored
90
.github/workflows/deb-packaging.yml
vendored
|
|
@ -29,6 +29,7 @@ env:
|
|||
COLOR_GREEN: "\e[32m"
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
STATUS_CONTEXT: 'Ubuntu Packaging'
|
||||
STATUS_CONTEXT_SOURCE_VERIFICATION: 'Linux source verification'
|
||||
DEBFULLNAME: 'Keyman GHA packager'
|
||||
DEBEMAIL: 'support@keyman.com'
|
||||
_builder_timings: false
|
||||
|
|
@ -403,3 +404,92 @@ jobs:
|
|||
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
|
||||
-f description="$MSG" \
|
||||
-f context="$STATUS_CONTEXT"
|
||||
|
||||
#---------------------------------------------------------------------------------------------
|
||||
source_verification:
|
||||
name: Verify source tarball and Linux source package
|
||||
if: github.repository == 'keymanapp/keyman' || github.event.client_payload.force
|
||||
needs: sourcepackage
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
KEYMAN_VERSION: ${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}
|
||||
|
||||
steps:
|
||||
- name: Set pending status on PR builds
|
||||
id: set_status
|
||||
if: github.event.client_payload.isTestBuild == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
gh api \
|
||||
--method POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
/repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.buildSha }} \
|
||||
-f state='pending' \
|
||||
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
|
||||
-f description='Linux source verification started' \
|
||||
-f context="$STATUS_CONTEXT_SOURCE_VERIFICATION"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: '${{ github.event.client_payload.buildSha }}'
|
||||
fetch-depth: 0
|
||||
clean: false
|
||||
path: ${{ github.workspace }}/keyman/
|
||||
|
||||
- name: Install devscripts
|
||||
uses: ./keyman/.github/actions/apt-install
|
||||
with:
|
||||
packages: devscripts equivs
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd ${{ github.workspace }}/keyman/linux
|
||||
./scripts/deb-packaging.sh --gha dependencies
|
||||
|
||||
- name: Verify source tarball
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ github.workspace }}/keyman/linux
|
||||
./scripts/verify_source.sh --source-only --target-dir "${{ github.workspace }}/keyman-${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}"
|
||||
|
||||
- name: Verify Ubuntu source package
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ github.workspace }}/keyman/linux
|
||||
./scripts/verify_source.sh --no-create-tarball --launchpad-only --target-dir "${{ github.workspace }}/keyman-${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}"
|
||||
|
||||
set_status_source_verification:
|
||||
name: Set result status of source verification on PR builds
|
||||
needs: [source_verification]
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ always() && github.event.client_payload.isTestBuild == 'true' }}
|
||||
steps:
|
||||
- name: Set success
|
||||
if: needs.source_verification.result == 'success'
|
||||
run: |
|
||||
echo "RESULT=success" >> $GITHUB_ENV
|
||||
echo "MSG=Linux source verification succeeded" >> $GITHUB_ENV
|
||||
|
||||
- name: Set cancelled
|
||||
if: needs.source_verification.result == 'cancelled'
|
||||
run: |
|
||||
echo "RESULT=error" >> $GITHUB_ENV
|
||||
echo "MSG=Linux source verification cancelled" >> $GITHUB_ENV
|
||||
|
||||
- name: Set failure
|
||||
if: needs.source_verification.result == 'failure'
|
||||
run: |
|
||||
echo "RESULT=failure" >> $GITHUB_ENV
|
||||
echo "MSG=Linux source verification failed" >> $GITHUB_ENV
|
||||
|
||||
- name: Set final status
|
||||
run: |
|
||||
gh api \
|
||||
--method POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
/repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.buildSha }} \
|
||||
-f state="$RESULT" \
|
||||
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
|
||||
-f description="$MSG" \
|
||||
-f context="$STATUS_CONTEXT_SOURCE_VERIFICATION"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
# Keyman Version History
|
||||
|
||||
## 19.0.230 alpha 2026-05-11
|
||||
|
||||
* chore(linux): add verification for source tarball and source package (#15916)
|
||||
* chore(linux): make `debian.sh` a builder script (#15924)
|
||||
* chore(linux): remove `--project` parameter (#15925)
|
||||
* maint(core): exclude `.configured` files from source tarball (#15928)
|
||||
* maint(core): retry upload to launchpad on network failures (#15930)
|
||||
* maint(linux): fix uploading to ppa (#15944)
|
||||
|
||||
## 19.0.229 alpha 2026-05-08
|
||||
|
||||
* maint(linux): fix source tarball used for packaging (#15926)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
19.0.230
|
||||
19.0.231
|
||||
|
|
@ -171,6 +171,17 @@ Package builds on Launchpad are triggered manually by running the Keyman script
|
|||
export DEBFULLNAME="Firstname Lastname"
|
||||
```
|
||||
|
||||
5. Create a `[keyman-ppa]` section in your `~/.config/dput/dput.cf` (or `~/.dput.cf`)
|
||||
config file:
|
||||
|
||||
```
|
||||
[keyman-ppa]
|
||||
fqdn = ppa.launchpad.net
|
||||
method = sftp
|
||||
incoming = ~keymanapp/%(keyman-ppa)s
|
||||
login = *
|
||||
```
|
||||
|
||||
### Building packages on Launchpad
|
||||
|
||||
The `launchpad.sh` script downloads the current source code (beta or stable) from
|
||||
|
|
@ -181,28 +192,19 @@ for the different distros and architectures.
|
|||
To upload the packages to launchpad, run the following script from the `linux/` directory:
|
||||
|
||||
```bash
|
||||
./scripts/launchpad.sh [UPLOAD="yes"] [KEYMAN_TIER="<tier>"] [PROJECT="<project>"] [DIST="<dist>"] [PACKAGEVERSION="<version>"]
|
||||
./scripts/launchpad.sh [options]
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- `UPLOAD="yes"` - do the dput for real
|
||||
- `KEYMAN_TIER="<tier>"` - alpha, beta, or stable, default from `../TIER.md`
|
||||
- `PROJECT="<project>"` - only upload this package
|
||||
- `DIST="<dist>"` - only upload for this distribution
|
||||
- `PACKAGEVERSION="<version>"` - normally use the default so don't specify
|
||||
it. But if you change packaging and run another upload you need to increment
|
||||
the number at the end of `PACKAGEVERSION`. e.g. next one is `1~sil2` then
|
||||
`1~sil3`…
|
||||
See `launchpad.sh --help` for supported parameters.
|
||||
|
||||
### Releasing a new version
|
||||
|
||||
As part of releasing a new version it might be good to do some local testing
|
||||
first before uploading to Launchpad:
|
||||
|
||||
- Run `launchpad.sh` with `UPLOAD="no"` to build the packages
|
||||
- Run `launchpad.sh` with `--simulate` to build the packages
|
||||
- Then install them on a clean VM and make sure no glaring bugs
|
||||
- Once you are happy with the packages you can run `launchpad.sh` with `UPLOAD="yes"`
|
||||
- Once you are happy with the packages you can run `launchpad.sh` with `--upload`
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ builder_parse "$@"
|
|||
|
||||
builder_run_child_actions clean configure build test install uninstall
|
||||
|
||||
clean_action() {
|
||||
rm -rf debian/patches
|
||||
}
|
||||
|
||||
test_action() {
|
||||
if builder_has_option --open; then
|
||||
builder_echo "Opening coverage reports in browser..."
|
||||
|
|
@ -41,5 +45,6 @@ test_action() {
|
|||
fi
|
||||
}
|
||||
|
||||
builder_run_action clean clean_action
|
||||
builder_run_action test test_action
|
||||
builder_run_action test:help check-markdown "${KEYMAN_ROOT}/linux/docs/help"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ clean_action() {
|
|||
rm -rf dist make_deb build ./*.egg-info keyman_config/version.py
|
||||
find . \( -name __pycache__ -o -name keyman-config.mo \) -exec rm -rf {} +
|
||||
rm -rf ../docs/help/reference/km-*.md
|
||||
rm -rf keyman_config/.pc
|
||||
|
||||
# Don't delete this file during a package build because they are
|
||||
# part of the source package. We can't generate it during a package
|
||||
|
|
|
|||
|
|
@ -1,42 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
#!/usr/bin/env bash
|
||||
# Build source packages suitable to import into the Debian package repos
|
||||
# (https://salsa.debian.org/input-method-team)
|
||||
|
||||
# must be run from linux dir
|
||||
|
||||
# parameters: [PROJECT=<project>] [DIST=<dist>] [DEBREVISION=<no>] ./scripts/debian.sh
|
||||
# PROJECT=<project> only process this project
|
||||
# DIST=<dist> distribution to create packages for (unstable, experimental, etc). If not
|
||||
# specified UNRELEASED will be used.
|
||||
# DEBREVISION=<no> the debian revision number. Defaults to 1.
|
||||
|
||||
set -e
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder-basic.inc.sh"
|
||||
# shellcheck source=resources/build/builder-full.inc.sh
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. $(dirname "$THIS_SCRIPT")/package-build.inc.sh
|
||||
# shellcheck source=linux/scripts/package-build.inc.sh
|
||||
. "$(dirname "${THIS_SCRIPT}")/package-build.inc.sh"
|
||||
|
||||
builder_describe \
|
||||
"Build source packages suitable to import into the Debian package repos" \
|
||||
build \
|
||||
"--dist=DIST Distribution to create packages for (unstable, experimental, etc). Default: UNRELEASED." \
|
||||
"--debrevision=DEBREVISION The debian revision number. Default: 1."
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
cd "${KEYMAN_ROOT}/linux"
|
||||
|
||||
checkPrerequisites
|
||||
|
||||
BASEDIR=$(pwd)
|
||||
|
||||
rm -rf debianpackage
|
||||
mkdir -p debianpackage
|
||||
|
||||
for proj in ${projects}; do
|
||||
downloadSource debianpackage
|
||||
downloadSource debianpackage
|
||||
|
||||
cd "${proj}-${version}"
|
||||
if [[ -n "${DIST}" ]]; then
|
||||
EXTRA_ARGS="--distribution ${DIST} --force-distribution"
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
dch --newversion "${version}-${DEBREVISION-1}" ${EXTRA_ARGS} ""
|
||||
debuild -d -S -sa -Zxz
|
||||
cd "${BASEDIR}"
|
||||
done
|
||||
cd "keyman-${version}"
|
||||
if builder_has_option --dist; then
|
||||
EXTRA_ARGS="--distribution ${DIST} --force-distribution"
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
dch --newversion "${version}-${DEBREVISION:-1}" ${EXTRA_ARGS:-} ""
|
||||
debuild -d -S -sa -Zxz
|
||||
|
|
|
|||
|
|
@ -3,11 +3,8 @@
|
|||
# Build dist tarballs or Debian orig tarballs
|
||||
# and put them in dist/
|
||||
|
||||
# parameters: ./dist.sh [origdist] [proj]
|
||||
# parameters: ./dist.sh [origdist]
|
||||
# origdist = create Debian orig.tar.xz
|
||||
# proj = only make tarball for this project
|
||||
|
||||
set -e
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
|
|
@ -134,13 +131,14 @@ dpkg-source \
|
|||
--tar-ignore=experiments \
|
||||
--tar-ignore=debian \
|
||||
--tar-ignore=.github \
|
||||
--tar-ignore=.pc \
|
||||
--tar-ignore=.vscode \
|
||||
--tar-ignore=.configured \
|
||||
--tar-ignore=.devcontainer \
|
||||
--tar-ignore=.pc \
|
||||
--tar-ignore=__pycache__ \
|
||||
--tar-ignore=node_modules \
|
||||
--tar-ignore=keyman_1* \
|
||||
--tar-ignore=launchpad \
|
||||
--tar-ignore=dist \
|
||||
--tar-ignore=VERSION \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -1,62 +1,128 @@
|
|||
#!/bin/bash
|
||||
|
||||
#!/usr/bin/env bash
|
||||
# Build source packages from nightly builds and upload to PPA
|
||||
|
||||
# parameters: [UPLOAD="yes"] [PROJECT="<project>"] [DIST="<dist>"] [PACKAGEVERSION="<version>"] ./scripts/launchpad.sh
|
||||
# UPLOAD="yes" do the dput for real
|
||||
# PROJECT="<project>" only upload this project
|
||||
# DIST="<dist>" only upload for this distribution
|
||||
# PACKAGEVERSION="<version>" string to append to the package version. Default to "1~sil1"
|
||||
|
||||
set -eu
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
# shellcheck source=resources/build/builder-basic.inc.sh
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder-basic.inc.sh"
|
||||
# shellcheck source=resources/build/builder-full.inc.sh
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
# shellcheck source=linux/scripts/package-build.inc.sh
|
||||
. "$(dirname "${THIS_SCRIPT}")/package-build.inc.sh"
|
||||
|
||||
builder_describe \
|
||||
"Build source packages from nightly builds and upload to PPA" \
|
||||
build \
|
||||
"--no-download Don't download source. Assume keyman-<version> exists as subdirectory of current dir." \
|
||||
"--upload Upload to launchpad." \
|
||||
"--simulate Simulate the upload to launchpad." \
|
||||
"--no-lintian Don't run lintian while creating source package." \
|
||||
"--dist=DIST Only upload this distribution. Default: upload all supported dists." \
|
||||
"--packageversion=PACKAGEVERSION String to append to the package version. Default: '1~sil1'." \
|
||||
"--outputdir=OUTPUTDIR Directory for resulting artifacts. Default: \$KEYMAN_ROOT/linux/launchpad." \
|
||||
"--retries=RETRIES Number of retries on network errors. Default: 5."
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
cd "${KEYMAN_ROOT}/linux"
|
||||
|
||||
checkPrerequisites
|
||||
|
||||
if [[ "${KEYMAN_TIER}" == "stable" ]]; then
|
||||
ppa="ppa:keymanapp/keyman"
|
||||
elif [[ "${KEYMAN_TIER}" == "beta" ]]; then
|
||||
ppa="ppa:keymanapp/keyman-beta"
|
||||
if [[ -z "${OUTPUTDIR:-}" ]]; then
|
||||
OUTPUTDIR="${KEYMAN_ROOT}/linux/launchpad"
|
||||
fi
|
||||
|
||||
if builder_has_option --simulate; then
|
||||
SIM="-s"
|
||||
else
|
||||
ppa="ppa:keymanapp/keyman-alpha"
|
||||
SIM=""
|
||||
fi
|
||||
|
||||
if builder_has_option --no-lintian; then
|
||||
LINTIAN_OPTS="--no-lintian"
|
||||
else
|
||||
LINTIAN_OPTS=""
|
||||
fi
|
||||
|
||||
if [[ "${KEYMAN_TIER}" == "stable" ]]; then
|
||||
ppa="keyman-ppa:keyman"
|
||||
elif [[ "${KEYMAN_TIER}" == "beta" ]]; then
|
||||
ppa="keyman-ppa:keyman-beta"
|
||||
else
|
||||
ppa="keyman-ppa:keyman-alpha"
|
||||
fi
|
||||
echo "ppa: ${ppa}"
|
||||
|
||||
function upload_with_retry() {
|
||||
local changes_file="$1"
|
||||
local retries="$2"
|
||||
local sim="$3"
|
||||
local ppa="$4"
|
||||
local attempt=0
|
||||
local max_attempts=$((retries+1))
|
||||
local rc=0
|
||||
local output
|
||||
|
||||
while (( attempt++ < max_attempts )); do
|
||||
builder_echo "Uploading ${changes_file} (attempt ${attempt}/${max_attempts})..."
|
||||
set -o pipefail
|
||||
# shellcheck disable=SC2312,SC2086 # no quotes for $sim - it might not be set
|
||||
output=$(dput ${sim:-} "${ppa}" "${changes_file}" 2>&1 | tee /dev/stderr)
|
||||
rc=$?
|
||||
set +o pipefail
|
||||
if [[ ${rc} == 0 ]]; then
|
||||
return 0
|
||||
fi
|
||||
# Check if error is a network-related error
|
||||
if [[ ${rc} == 1 ]] && echo "${output}" | grep -iE 'Connection reset|Connection refused|Network is unreachable|Name or service not known|Connection timed out|Temporary failure|Broken pipe|Connection aborted' > /dev/null 2>&1; then
|
||||
if (( attempt < max_attempts )); then
|
||||
builder_echo warning "Network error detected, retrying..."
|
||||
sleep $((attempt * 5))
|
||||
fi
|
||||
else
|
||||
# Non-network error, fail immediately
|
||||
builder_echo error "Upload failed with non-network error (exit code: ${rc})"
|
||||
builder_echo error "${output}"
|
||||
return "${rc}"
|
||||
fi
|
||||
done
|
||||
|
||||
builder_echo error "Failed to upload after ${max_attempts} attempts"
|
||||
return 1
|
||||
}
|
||||
|
||||
distributions="${DIST:-jammy noble questing resolute}"
|
||||
packageversion="${PACKAGEVERSION:-1~sil1}"
|
||||
retries="${RETRIES:-5}"
|
||||
|
||||
BASEDIR=$(pwd)
|
||||
if ! builder_has_option --no-download; then
|
||||
rm -rf launchpad
|
||||
mkdir -p launchpad
|
||||
fi
|
||||
|
||||
rm -rf launchpad
|
||||
mkdir -p launchpad
|
||||
|
||||
for proj in ${projects:-}; do
|
||||
if ! builder_has_option --no-download; then
|
||||
downloadSource launchpad
|
||||
else
|
||||
version=$(cat "${KEYMAN_ROOT}/VERSION.md")
|
||||
cd "${OUTPUTDIR}"
|
||||
fi
|
||||
|
||||
cd "${proj}-${version:-}"
|
||||
pwd
|
||||
cp debian/changelog "../${proj}-changelog"
|
||||
for dist in ${distributions}; do
|
||||
cp "../${proj}-changelog" debian/changelog
|
||||
dch -v "${version}-${packageversion}~${dist}" "source package for PPA"
|
||||
dch -D "${dist}" -r ""
|
||||
debuild -d -S -sa -Zxz
|
||||
done
|
||||
cd "keyman-${version:-}"
|
||||
pwd
|
||||
cp debian/changelog "../keyman-changelog"
|
||||
for dist in ${distributions}; do
|
||||
cp "../keyman-changelog" debian/changelog
|
||||
dch -v "${version}-${packageversion}~${dist}" "source package for PPA"
|
||||
dch -D "${dist}" -r ""
|
||||
# shellcheck disable=SC2248 # no quotes for $LINTIAN_OPTS - might be empty string
|
||||
debuild ${LINTIAN_OPTS} -d -S -sa -Zxz
|
||||
done
|
||||
if builder_has_option --upload || builder_has_option --simulate; then
|
||||
cd ..
|
||||
for dist in ${distributions}; do
|
||||
# shellcheck disable=SC2086,SC2248 # no quotes for $SIM - it might not be set
|
||||
dput ${SIM:-} "${ppa}" "${proj}_${version}-${packageversion}~${dist}_source.changes"
|
||||
if ! upload_with_retry "keyman_${version}-${packageversion}~${dist}_source.changes" "${retries}" "${SIM}" "${ppa}"; then
|
||||
builder_die "Upload failed for distribution ${dist}"
|
||||
fi
|
||||
done
|
||||
cd "${BASEDIR}"
|
||||
done
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -2,53 +2,42 @@
|
|||
# Keyman is copyright (C) SIL Global. MIT License.
|
||||
|
||||
function checkPrerequisites() {
|
||||
if [[ "${UPLOAD:=}" == "yes" ]]; then
|
||||
SIM=""
|
||||
else
|
||||
SIM="-s"
|
||||
fi
|
||||
|
||||
# Check the tier
|
||||
if [[ -z "${KEYMAN_TIER:=}" ]]; then
|
||||
echo "TIER.md or \${KEYMAN_TIER} must be set to (alpha, beta, stable) to use this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v xmllint > /dev/null; then
|
||||
if ! builder_has_option --no-download && ! command -v xmllint > /dev/null; then
|
||||
echo "you must install xmllint (libxml2-utils package) to use this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
projects="${PROJECT:=keyman}"
|
||||
}
|
||||
|
||||
function downloadSource() {
|
||||
local packageDir
|
||||
packageDir=$1
|
||||
|
||||
if [[ "${proj:=}" == "keyman" ]]; then
|
||||
# shellcheck disable=SC2154
|
||||
cd "${BASEDIR}" || exit
|
||||
./build.sh clean
|
||||
fi
|
||||
# shellcheck disable=SC2154
|
||||
cd "${KEYMAN_ROOT}/linux" || exit
|
||||
./build.sh clean
|
||||
|
||||
# Update tier in Debian watch files (replacing any previously set tier) and remove comment
|
||||
sed -e "s/\$tier\|alpha\|beta\|stable/${KEYMAN_TIER}/g" -e "s/^# .*$//" "${BASEDIR}"/scripts/watch.in > debian/watch
|
||||
sed -e "s/\$tier\|alpha\|beta\|stable/${KEYMAN_TIER}/g" -e "s/^# .*$//" "${KEYMAN_ROOT}/linux/scripts/watch.in" > debian/watch
|
||||
|
||||
version=$(uscan --report --dehs|xmllint --xpath "//dehs/upstream-version/text()" -)
|
||||
dirversion=$(uscan --report --dehs|xmllint --xpath "//dehs/upstream-url/text()" - | cut -d/ -f6)
|
||||
echo "${proj} version is ${version}"
|
||||
uscan || (echo "ERROR: No new version available for ${proj}" >&2 && exit 1)
|
||||
echo "Keyman version is ${version}"
|
||||
uscan || (echo "ERROR: No new version available for keyman" >&2 && exit 1)
|
||||
cd ..
|
||||
mv "${proj}-${version}" "${BASEDIR}/${packageDir}"
|
||||
mv "${proj}_${version}.orig.tar.xz" "${BASEDIR}/${packageDir}"
|
||||
mv "${proj}_${version}.pkg.tar.xz" "${BASEDIR}/${packageDir}"
|
||||
mv "${proj}"*.asc "${BASEDIR}/${packageDir}"
|
||||
rm "${proj}"*.debian.tar.xz
|
||||
cd "${BASEDIR}/${packageDir}" || exit
|
||||
mv "keyman-${version}" "${KEYMAN_ROOT}/linux/${packageDir}"
|
||||
mv "keyman_${version}.orig.tar.xz" "${KEYMAN_ROOT}/linux/${packageDir}"
|
||||
mv "keyman_${version}.pkg.tar.xz" "${KEYMAN_ROOT}/linux/${packageDir}"
|
||||
mv "keyman"*.asc "${KEYMAN_ROOT}/linux/${packageDir}"
|
||||
rm "keyman"*.debian.tar.xz
|
||||
cd "${KEYMAN_ROOT}/linux/${packageDir}" || exit
|
||||
wget -N "https://downloads.keyman.com/linux/${KEYMAN_TIER}/${dirversion}/SHA256SUMS"
|
||||
sha256sum -c --ignore-missing SHA256SUMS | grep "${proj}"
|
||||
sha256sum -c --ignore-missing SHA256SUMS | grep "keyman"
|
||||
}
|
||||
|
||||
function wait_for_apt_deb {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ git pull origin "${DEPLOY_BRANCH}"
|
|||
|
||||
builder_heading "Building source package"
|
||||
cd "${WORKTREE_DIR}/linux"
|
||||
DIST=unstable DEBREVISION=${REVISION} scripts/debian.sh
|
||||
scripts/debian.sh --dist unstable --debrevision "${REVISION}"
|
||||
cd debianpackage/
|
||||
builder_heading "Signing source package"
|
||||
debsign -k"${DEBKEYID}" --re-sign ./*.changes
|
||||
|
|
|
|||
102
linux/scripts/verify_source.sh
Executable file
102
linux/scripts/verify_source.sh
Executable file
|
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env bash
|
||||
# This script serves two purposes:
|
||||
# - Verify Keyman builds from source tarball
|
||||
# - Verify source package (that will be uploaded to Launchpad) does not
|
||||
# produce lintian errors
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
# shellcheck source=resources/build/builder-full.inc.sh
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
builder_describe \
|
||||
"Verify source tarball and source package" \
|
||||
build \
|
||||
"--no-create-tarball Skip creating a new tarball. Instead use existing one." \
|
||||
"--source-only Only check that it's possible to build Keyman from the source tarball." \
|
||||
"--launchpad-only Only check that lintian doesn't produce errors when run on the source package." \
|
||||
"--target-dir=TARGET_DIR Directory where to put generate files. Default: /tmp/keyman-<version>."
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
if ! builder_has_option --target-dir; then
|
||||
TARGET_DIR="/tmp/keyman-${KEYMAN_VERSION}"
|
||||
fi
|
||||
|
||||
create_source_tarball() {
|
||||
local target_dir="$1"
|
||||
|
||||
builder_echo "Create source tarball"
|
||||
rm -rf dist
|
||||
./scripts/reconf.sh
|
||||
PKG_CONFIG_PATH="${KEYMAN_ROOT}/core/build/arch/release/meson-private" ./scripts/dist.sh
|
||||
|
||||
mkdir -p "${target_dir}"
|
||||
cp dist/keyman-*.tar.xz "${target_dir}"
|
||||
}
|
||||
|
||||
extract_source_tarball() {
|
||||
local target_dir="$1"
|
||||
|
||||
builder_echo "Extract source tarball"
|
||||
cd "${target_dir}"
|
||||
tar -xvf keyman-*.tar.xz
|
||||
}
|
||||
|
||||
verify_can_build() {
|
||||
local target_dir="$1"
|
||||
builder_echo heading "Verifying build of tarball"
|
||||
cd "${target_dir}"
|
||||
./build.sh configure,build
|
||||
}
|
||||
|
||||
create_source_package() {
|
||||
local target_dir="$1"
|
||||
|
||||
# Production code uses uscan to download the latest tarball from
|
||||
# downloads.keyman.com/linux and then basically copies the debian
|
||||
# directory from the source repo. Since we want to work on code that
|
||||
# is not released yet we do similar steps here and then skip the
|
||||
# download in the launchpad script.
|
||||
cd "${target_dir}"
|
||||
mkdir -p launchpad
|
||||
cd launchpad
|
||||
cp -r "../keyman" "keyman-${KEYMAN_VERSION}"
|
||||
cp -r "${KEYMAN_ROOT}/linux/debian" "keyman-${KEYMAN_VERSION}"
|
||||
cp "${target_dir}/keyman-${KEYMAN_VERSION}.tar.xz" "keyman_${KEYMAN_VERSION}.orig.tar.xz"
|
||||
"keyman-${KEYMAN_VERSION}/linux/scripts/launchpad.sh" --no-download \
|
||||
--dist "$(lsb_release -c -s)" --outputdir "${target_dir}/launchpad" --no-lintian
|
||||
}
|
||||
|
||||
verify_lintian() {
|
||||
builder_echo heading "Running lintian"
|
||||
lintian "keyman_${KEYMAN_VERSION}"*source.changes
|
||||
}
|
||||
|
||||
cd "${KEYMAN_ROOT}/linux"
|
||||
|
||||
if ! builder_has_option --no-create-tarball; then
|
||||
builder_echo start tarball "Building source tarball"
|
||||
create_source_tarball "${TARGET_DIR}"
|
||||
builder_echo end tarball success "Finished building source tarball"
|
||||
fi
|
||||
|
||||
if ! builder_has_option --launchpad-only; then
|
||||
builder_echo start verifySource "Verifying source tarball"
|
||||
extract_source_tarball "${TARGET_DIR}"
|
||||
verify_can_build "${TARGET_DIR}/keyman"
|
||||
rm -rf "${TARGET_DIR}/keyman"
|
||||
builder_echo end verifySource success "Finished verifying source tarball"
|
||||
fi
|
||||
|
||||
if ! builder_has_option --source-only; then
|
||||
builder_echo start lintian "Verifying Launchpad source package"
|
||||
extract_source_tarball "${TARGET_DIR}"
|
||||
create_source_package "${TARGET_DIR}"
|
||||
verify_lintian
|
||||
rm -rf "${TARGET_DIR}/keyman"
|
||||
rm -rf "${TARGET_DIR}/launchpad"
|
||||
builder_echo end lintian success "Finished verifying Launchpad source package"
|
||||
fi
|
||||
|
|
@ -112,7 +112,7 @@ function _publish_to_launchpad() {
|
|||
git reset --hard
|
||||
|
||||
/usr/lib/gnupg/gpg-preset-passphrase --passphrase "${GPGKEYPW}" --preset "${GPGKEYGRIP}"
|
||||
UPLOAD=yes "${KEYMAN_ROOT}/linux/scripts/launchpad.sh"
|
||||
"${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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue