Remove native plugin C API #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'CMakeLists.txt' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g. 0.9.0). Leave empty to read from CMakeLists.txt.' | |
| required: false | |
| type: string | |
| default: '' | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ββ Version gate βββββββββββββββββββββββββββββββββββββββββββββββ | |
| version-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_release: ${{ steps.check.outputs.should_release }} | |
| version: ${{ steps.check.outputs.version }} | |
| steps: | |
| - name: 'π§° Checkout' | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'π Check version bump and changelog' | |
| id: check | |
| run: | | |
| MANUAL_VERSION="${{ inputs.version }}" | |
| EVENT_NAME="${{ github.event_name }}" | |
| # Extract version from HEAD CMakeLists.txt | |
| NEW_VERSION=$(grep -oP 'project\(AeonGUI VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) | |
| if [[ -z "$NEW_VERSION" ]]; then | |
| echo "::error::Could not parse version from CMakeLists.txt" | |
| exit 1 | |
| fi | |
| if [[ -n "$MANUAL_VERSION" ]]; then | |
| # Manual dispatch with explicit version | |
| NEW_VERSION="$MANUAL_VERSION" | |
| echo "Manual dispatch with version: $NEW_VERSION" | |
| elif [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then | |
| # Manual dispatch without version: use CMakeLists.txt version, | |
| # skip commit comparisonβtag existence check below is sufficient | |
| echo "Manual dispatch using CMakeLists.txt version: $NEW_VERSION" | |
| else | |
| # Push trigger: compare HEAD vs previous commit | |
| BEFORE="${{ github.event.before }}" | |
| OLD_VERSION=$(git show "${BEFORE}:CMakeLists.txt" 2>/dev/null \ | |
| | grep -oP 'project\(AeonGUI VERSION \K[0-9]+\.[0-9]+\.[0-9]+' || echo "0.0.0") | |
| echo "Previous commit version: $OLD_VERSION" | |
| echo "Current commit version: $NEW_VERSION" | |
| # If version unchanged in this push, skip silently | |
| if [[ "$NEW_VERSION" == "$OLD_VERSION" ]]; then | |
| echo "Version unchanged ($NEW_VERSION), skipping release" | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| # Fail if the new version is lower than the previous | |
| HIGHER=$(printf '%s\n%s' "$OLD_VERSION" "$NEW_VERSION" | sort -V | tail -1) | |
| if [[ "$HIGHER" == "$OLD_VERSION" ]]; then | |
| echo "::error::Version $NEW_VERSION is lower than previous $OLD_VERSION" | |
| exit 1 | |
| fi | |
| # Fail if CHANGELOG.md was not modified in this push | |
| if ! git diff --name-only "${BEFORE}" "${{ github.sha }}" | grep -q '^CHANGELOG.md$'; then | |
| echo "::error::Version bumped to $NEW_VERSION but CHANGELOG.md was not updated" | |
| exit 1 | |
| fi | |
| fi | |
| # Also verify against the latest release tag (catches manual dispatch regressions) | |
| LATEST_TAG=$(git tag -l 'v*' --sort=-version:refname | head -n1 || true) | |
| if [[ -n "$LATEST_TAG" ]]; then | |
| TAG_VERSION="${LATEST_TAG#v}" | |
| if [[ "$NEW_VERSION" == "$TAG_VERSION" && "$EVENT_NAME" != "workflow_dispatch" ]]; then | |
| echo "Version $NEW_VERSION already released as $LATEST_TAG, skipping" | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| HIGHER=$(printf '%s\n%s' "$TAG_VERSION" "$NEW_VERSION" | sort -V | tail -1) | |
| if [[ "$HIGHER" == "$TAG_VERSION" && "$NEW_VERSION" != "$TAG_VERSION" ]]; then | |
| echo "::error::Version $NEW_VERSION is lower than existing release $TAG_VERSION" | |
| exit 1 | |
| fi | |
| fi | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
| # ββ Create tag and GitHub release ββββββββββββββββββββββββββββββ | |
| create-release: | |
| needs: version-check | |
| if: needs.version-check.outputs.should_release == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'π§° Checkout' | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'π·οΈ Create tag' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| TAG="v${{ needs.version-check.outputs.version }}" | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "Tag $TAG already exists, skipping" | |
| else | |
| git tag -a "$TAG" -m "Release $TAG" | |
| git push origin "$TAG" | |
| fi | |
| - name: 'π¦ Create GitHub Release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.version-check.outputs.version }} | |
| name: AeonGUI v${{ needs.version-check.outputs.version }} | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| # ββ Arch package + all build scripts (Ubuntu) ββββββββββββββββββ | |
| arch-and-scripts: | |
| needs: [version-check, create-release] | |
| if: needs.version-check.outputs.should_release == 'true' | |
| runs-on: ubuntu-latest | |
| container: archlinux:base-devel | |
| steps: | |
| - name: 'π§° Checkout' | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: v${{ needs.version-check.outputs.version }} | |
| - name: 'π¦ Install dependencies' | |
| run: | | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm cmake make gcc flex bison pkgconf \ | |
| cairo pango fontconfig freetype2 harfbuzz libxml2 zlib libpng libjpeg-turbo \ | |
| mesa libx11 python \ | |
| git curl | |
| # ββ Generate all packaging scripts (no build deps needed) ββ | |
| - name: 'π Generate packaging scripts' | |
| run: cmake -B scripts-build -DBUILD_SCRIPTS_ONLY=ON | |
| # ββ Arch binary package ββ | |
| - name: 'π οΈ Prepare Arch PKGBUILD' | |
| run: cp scripts-build/PKGBUILD-arch PKGBUILD | |
| - name: 'π¦ Build Arch package' | |
| run: | | |
| useradd -m builder | |
| echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder | |
| chown -R builder: . | |
| su builder -c "makepkg -s --noconfirm --skippgpcheck" | |
| # ββ Package build scripts ββ | |
| - name: 'π¦ Package Arch PKGBUILD' | |
| run: tar -czf PKGBUILD-arch-${{ needs.version-check.outputs.version }}.tar.gz PKGBUILD | |
| - name: 'π¦ Package MSYS2 PKGBUILD' | |
| run: | | |
| cp scripts-build/PKGBUILD-msys2 PKGBUILD-msys2 | |
| tar -czf PKGBUILD-msys2-${{ needs.version-check.outputs.version }}.tar.gz PKGBUILD-msys2 | |
| # ββ Homebrew formula with sha256 ββ | |
| - name: 'π Compute source tarball sha256' | |
| id: hashes | |
| run: | | |
| curl -sL "https://github.com/AeonGames/AeonGUI/archive/v${{ needs.version-check.outputs.version }}.tar.gz" -o source.tar.gz | |
| echo "sha256=$(sha256sum source.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT" | |
| - name: 'π¦ Package Homebrew formula' | |
| run: | | |
| sed -i 's/sha256 ""/sha256 "${{ steps.hashes.outputs.sha256 }}"/' scripts-build/aeongui.rb | |
| tar -czf aeongui-brew-${{ needs.version-check.outputs.version }}.tar.gz -C scripts-build aeongui.rb | |
| # ββ vcpkg port ββ | |
| - name: 'π¦ Create vcpkg port archive' | |
| run: | | |
| tar -czf "aeongui-vcpkg-port-${{ needs.version-check.outputs.version }}.tar.gz" -C scripts-build/vcpkg-port . | |
| # ββ Upload everything ββ | |
| - name: 'π€ Upload release assets' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.version-check.outputs.version }} | |
| files: | | |
| *.pkg.tar.zst | |
| PKGBUILD-arch-${{ needs.version-check.outputs.version }}.tar.gz | |
| PKGBUILD-msys2-${{ needs.version-check.outputs.version }}.tar.gz | |
| aeongui-brew-${{ needs.version-check.outputs.version }}.tar.gz | |
| aeongui-vcpkg-port-${{ needs.version-check.outputs.version }}.tar.gz | |
| # ββ MSYS2 packages (mingw64, ucrt64, clang64 β Cairo) βββββββββ | |
| msys2-package: | |
| needs: [version-check, create-release] | |
| if: needs.version-check.outputs.should_release == 'true' | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sys: [mingw64, ucrt64, clang64] | |
| include: | |
| - { sys: mingw64, icon: 'π¦' } | |
| - { sys: ucrt64, icon: 'π¨' } | |
| - { sys: clang64, icon: 'π§' } | |
| name: π¦${{ matrix.icon }} MSYS2 ${{ matrix.sys }} | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: 'π§° Checkout' | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: v${{ needs.version-check.outputs.version }} | |
| - name: '${{ matrix.icon }} Setup MSYS2' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.sys }} | |
| update: true | |
| install: >- | |
| git | |
| make | |
| flex | |
| bison | |
| pacboy: >- | |
| toolchain:p | |
| cmake:p | |
| make:p | |
| - name: 'π οΈ Configure to generate PKGBUILD' | |
| run: | | |
| cmake -G "MSYS Makefiles" -B build -DBUILD_SCRIPTS_ONLY=ON | |
| cp build/PKGBUILD-msys2 PKGBUILD | |
| - name: 'π¦ Build package' | |
| env: | |
| MINGW_ARCH: ${{ matrix.sys }} | |
| run: makepkg-mingw -s --noconfirm --skippgpcheck | |
| - name: 'π€ Upload MSYS2 package' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.version-check.outputs.version }} | |
| files: '*.pkg.tar.zst' |