dep-libtommath/.github/workflows/deploy.yml
Steffen Jaeckel 3c0c20e4cb Run deploy job also for ARM.
1. Also run tests before packaging the library.
2. Use different packagecloud GH action, since official one doesn't support
   running on ARM.
3. Update `PACKAGE_RELEASE_VERSION` on each deploy run.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 12:32:51 +02:00

57 lines
2.5 KiB
YAML

#############################################################################
# #
# Packagecloud deployment via GH actions for LibTomMath #
# (https://github.com/libtom/libtommath.git) #
# #
#############################################################################
name: Deploy
on:
workflow_dispatch
jobs:
deploy-to-packagecloud:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm ]
steps:
- uses: actions/checkout@v2
- name: set Ubuntu codename
run: |
echo "ubuntu_codename="$(lsb_release -sc) >> "$GITHUB_ENV"
- name: install dependencies
run: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${{ env.ubuntu_codename }} main" | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update -qq
sudo apt-get install -y cmake gcc
- name: build packages
run: |
mkdir -p build demo/build
cd build
cmake -DBUILD_SHARED_LIBS=Off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="/usr" -DPACKAGE_RELEASE_VERSION="$GITHUB_RUN_NUMBER" ..
make -j$(nproc)
pushd ../demo/build
cmake ..
make -j$(nproc)
ctest
popd
cpack -DPACKAGE_RELEASE_VERSION="$GITHUB_RUN_NUMBER" -G DEB
cmake -DBUILD_SHARED_LIBS=On -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="/usr" -DPACKAGE_RELEASE_VERSION="$GITHUB_RUN_NUMBER" ..
make -j$(nproc)
pushd ../demo/build
cmake ..
make -j$(nproc)
ctest
popd
cpack -DPACKAGE_RELEASE_VERSION="$GITHUB_RUN_NUMBER" -G DEB
- name: push deb packages to packagecloud.io
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: build/packages/ubuntu/${{ env.ubuntu_codename }}/*.deb
PACKAGECLOUD-USERNAME: libtom
PACKAGECLOUD-REPO: packages
PACKAGECLOUD-DISTRIB: ubuntu/${{ env.ubuntu_codename }}
PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}