Fix typos, fix some warnings, added more compile options, moved to forgejo CI
Some checks failed
Main LMDBAL workflow / Test LMDBAL with qt5 (push) Has been cancelled
Main LMDBAL workflow / Test LMDBAL with qt6 (push) Has been cancelled
Main LMDBAL workflow / Release documentation (push) Has been cancelled

This commit is contained in:
Blue 2025-05-02 18:19:06 +03:00
parent 3ae1fd15c0
commit 1585b8e4f5
Signed by: blue
GPG key ID: 9B203B252A63EE38
15 changed files with 204 additions and 120 deletions

View file

@ -0,0 +1,80 @@
name: Release to AUR
on:
workflow_call:
inputs:
package-name:
required: true
type: string
description:
required: true
type: string
depends:
required: true
type: string
flags:
required: true
type: string
workflow_dispatch:
inputs:
package-name:
description: "The name under which the package is going to be packaged to AUR"
type: string
default: "lmdbal"
description:
description: "The description of the package"
type: string
default: "LMDB Abstraction Layer"
depends:
description: "Additional dependencies"
type: string
default: ""
flags:
description: "Additional CMake flags"
type: string
default: ""
jobs:
aur:
name: Releasing ${{ inputs.package-name }} to AUR
runs-on: archlinux
steps:
- name: Download the release tarball
run: curl -sL ${{ gitea.server_url }}/${{ gitea.repository }}/archive/${{ gitea.event.release.tag_name }}.tar.gz --output tarball.tar.gz
- name: Calculate SHA256 for the tarball
run: echo "tbSum=$(sha256sum tarball.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Unarchive tarball
run: tar -xvzf tarball.tar.gz
- name: Clone the AUR repository
run: |
echo "${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}" > key
chmod 600 key
GIT_SSH_COMMAND="ssh -i key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git clone ssh://aur@aur.archlinux.org/${{ inputs.package-name }}.git aur
chmod 777 -R aur
cd aur
git config user.name ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
git config user.email ${{ secrets.DEPLOY_TO_AUR_EMAIL }}
git checkout -b master || git checkout master
- name: Copy PKGBUILD to the directory
run: cp lmdbal/packaging/Archlinux/PKGBUILD aur/
- name: Patch PKGBUILD file, and generate .SRCINFO
working-directory: aur
run: |
sed -i "/sha256sums=/c\sha256sums=('${{ env.tbSum }}')" PKGBUILD
sed -i "/pkgname=lmdbal/c\pkgname=${{ inputs.package-name }}" PKGBUILD
sed -i "/pkgver=1.0.0/c\pkgver=${{ gitea.event.release.tag_name }}" PKGBUILD
sed -i "/pkgdesc=\"LMDB Abstraction Layer\"/c\pkgdesc=\"${{ inputs.description }}\"" PKGBUILD
sed -i "/depends=( 'lmdb' )/c\depends=( 'lmdb' ${{ inputs.depends }} )" PKGBUILD
sed -i '/cmake . -D/s/$/ ${{ inputs.flags }}/' PKGBUILD
sudo -u build makepkg --printsrcinfo > .SRCINFO
- name: Commit package to aur
working-directory: aur
run: |
git add PKGBUILD .SRCINFO
git commit -m "${{ gitea.event.release.body }}"
GIT_SSH_COMMAND="ssh -i ../key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git push origin master

View file

@ -0,0 +1,49 @@
name: Main LMDBAL workflow
run-name: ${{ gitea.actor }} is running LMDBAL main workflow
on:
push:
branches:
- master
jobs:
test-qt5:
name: Test LMDBAL with qt5
uses: ./.forgejo/workflows/test.yml
with:
flags: -D QT_VERSION_MAJOR=5 -D LMDBAL_NAME=LMDBAL-QT5
test-qt6:
name: Test LMDBAL with qt6
uses: ./.forgejo/workflows/test.yml
with:
flags: -D QT_VERSION_MAJOR=6 -D LMDBAL_NAME=LMDBAL-QT6
docs:
name: Release documentation
runs-on: archlinux
needs: [test-qt5, test-qt6]
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Make a build directory
run: mkdir build
- name: Configure
working-directory: ./build
run: cmake .. LMDBAL_BUILD_DOC_HTML=True -D LMDBAL_BUILD_DOC_XML=True -D LMDBAL_BUILD_DOC_MAN=True -D LMDBAL_BUILD_DOXYGEN_AWESOME=True
- name: Build
working-directory: ./build
run: cmake --build .
- name: Copy docs via scp
uses: appleboy/scp-action@master
# working-directory: ./build/doc //doesn't work
with:
host: ${{ secrets.DOMAIN_ROOT }}
username: ${{ secrets.DEPLOY_USER_NAME }}
key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
source: "build/doc/html/*,build/doc/xml/*,build/doc/man/*"
target: "/srv/lmdbal/doc"
strip_components: 2

View file

@ -0,0 +1,33 @@
name: LMDBAL Release workflow
run-name: ${{ gitea.actor }} is running LMDBAL Release workflow on release ${{ gitea.event.release.tag_name }}
on:
release:
types: [published]
jobs:
qt5:
name: Release qt5 build to AUR
uses: ./.forgejo/workflows/aur.yml
with:
package-name: lmdbal-qt5
description: LMDB Abstraction Layer, qt5 version
depends: 'qt5-base'
flags: -D QT_VERSION_MAJOR=5 -D LMDBAL_NAME=LMDBALQT5
secrets:
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
DEPLOY_TO_AUR_EMAIL: ${{ secrets.DEPLOY_TO_AUR_EMAIL }}
qt6:
name: Release qt6 build to AUR
uses: ./.forgejo/workflows/aur.yml
with:
package-name: lmdbal-qt6
description: LMDB Abstraction Layer, qt6 version
depends: 'qt6-base'
flags: -D QT_VERSION_MAJOR=6 -D LMDBAL_NAME=LMDBALQT6
secrets:
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
DEPLOY_TO_AUR_EMAIL: ${{ secrets.DEPLOY_TO_AUR_EMAIL }}

View file

@ -0,0 +1,36 @@
name: Build and run unit tests for LMDBAL
on:
workflow_call:
inputs:
flags:
required: true
type: string
workflow_dispatch:
inputs:
flags:
description: "Flags for CMake configure stage"
type: string
default: "lmdbal"
jobs:
test:
name: Building and running unit tests
runs-on: archlinux
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Make a build directory
run: mkdir build
- name: Configure
working-directory: ./build
run: cmake .. -D LMDBAL_STRICT=True -D LMDBAL_BUILD_TESTS=True -D QT_VERSION_MAJOR= ${{ inputs.flags }}
- name: Build
working-directory: ./build
run: cmake --build .
- name: Run tests
working-directory: ./build/test
run: ./runUnitTests