libcreate/.forgejo/workflows/package.yaml
jakob.kampichler 661fa82f6e
All checks were successful
Build and test / test (push) Successful in 2m2s
Build and test / test (pull_request) Successful in 1m56s
ci: also include Botball repo
2025-06-06 20:39:07 +02:00

76 lines
2.2 KiB
YAML

---
name: Package
on:
push:
tags:
- "*"
jobs:
package:
strategy:
matrix:
platform:
- dpkg: arm64
runs-on: debian-12-arm64
runs-on: debian-12-arm64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install dependencies
run: |
apt update
apt install -y \
build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest
- uses: actions/checkout@v4
- name: configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCPACK_DEBIAN_PACKAGE_RELEASE=compair1
- name: build
run: cmake --build build --config Release -j2
- name: test
working-directory: build
run: ctest -C Release
- name: build deb
working-directory: build
run: cpack --build . -G DEB
- name: get tag
run: |
echo "TAG=$(git describe --abbrev=0 --tags)-compair1" >>$GITHUB_ENV
# https://forgejo.org/docs/latest/user/packages/debian/#publish-a-package
- name: push deb to apt repository
env:
REPO: ${{ github.repository }}
run: |
url="${GITHUB_SERVER_URL}/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload"
urlBotball="${GITHUB_SERVER_URL}/api/packages/Botball/debian/pool/bookworm/wombatos/upload"
echo "api url: $url"
debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb"
echo "uploading file: $debfile"
curl --fail-with-body \
-X PUT \
--user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \
--upload-file "$debfile" \
"$url"
echo "uploading file for WombatOs: $debfile"
curl --fail-with-body \
-X PUT \
--user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \
--upload-file "$debfile" \
"$urlBotball"
echo "final url: ${GITHUB_SERVER_URL}/${{ github.repository_owner }}/-/packages/debian/libcreate/${TAG}"
echo "final url for Botball: ${GITHUB_SERVER_URL}/Botball/-/packages/debian/libcreate/${TAG}"