Skip to content

Commit

Permalink
Merge pull request #9812 from keymanapp/chore/linux/update-gha
Browse files Browse the repository at this point in the history
chore(linux): Update packaging GHA 〽️
  • Loading branch information
ermshiperete authored Oct 20, 2023
2 parents 374b1fa + 1c639e8 commit 054e1a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/deb-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ jobs:
- name: Verify API
run: |
cd linux
if [ -f debian/libkeymancore.symbols ]; then
PKG_NAME=libkeymancore
else
PKG_NAME=libkmnkbp0-0
fi
SRC_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-srcpkg/keyman_${{ needs.sourcepackage.outputs.VERSION }}-1.debian.tar.xz" \
BIN_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-binarypkgs/libkmnkbp0-0_${{ needs.sourcepackage.outputs.VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+jammy1_amd64.deb" \
BIN_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-binarypkgs/${PKG_NAME}_${{ needs.sourcepackage.outputs.VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+jammy1_amd64.deb" \
PKG_VERSION="${{ needs.sourcepackage.outputs.VERSION }}" \
./scripts/deb-packaging.sh --gha verify 2>> $GITHUB_STEP_SUMMARY
Expand All @@ -254,6 +259,13 @@ jobs:
path: linux/debian/libkmnkbp0-0.symbols
if: always()

- name: Archive .symbols file
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: libkeymancore.symbols
path: linux/debian/libkeymancore.symbols
if: always()

set_status:
name: Set result status on PR builds
needs: [sourcepackage, binary_packages, api_verification]
Expand Down
15 changes: 11 additions & 4 deletions linux/scripts/deb-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,21 @@ fi

if builder_start_action verify; then
tar xf "${SRC_PKG}"
if [ ! -f debian/libkmnkbp0-0.symbols ]; then
echo ":warning: Missing libkmnkbp0-0.symbols file" >&2
if [ ! -f debian/libkmnkbp0-0.symbols ] && [ ! -f debian/libkeymancore.symbols ]; then
echo ":warning: Missing libkmnkbp0-0.symbols/libkeymancore.symbols file" >&2
else
if [ -f debian/libeymancore.symbols ]; then
PKG_NAME=libkeymancore
LIB_NAME=libkeymancore
else
PKG_NAME=libkmnkbp0-0
LIB_NAME=libkmnkbp0
fi
tmpDir=$(mktemp -d)
dpkg -x "${BIN_PKG}" "$tmpDir"
cd debian
dpkg-gensymbols -v"${PKG_VERSION}" -plibkmnkbp0-0 -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/libkmnkbp0.so* -Olibkmnkbp0-0.symbols -c4
echo ":heavy_check_mark: libkmnkbp0-0 API didn't change" >&2
dpkg-gensymbols -v"${PKG_VERSION}" -p${PKG_NAME} -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/${LIB_NAME}.so* -O${PKG_NAME}.symbols -c4
echo ":heavy_check_mark: ${LIB_NAME} API didn't change" >&2
fi
builder_finish_action success verify
exit 0
Expand Down

0 comments on commit 054e1a2

Please sign in to comment.