From 3abe885ab4e17cb0ee304f7a2828053f1ff25c2a Mon Sep 17 00:00:00 2001 From: sanasol Date: Fri, 20 Feb 2026 00:54:58 +0100 Subject: [PATCH] ci: adapt release workflow for Forgejo - Windows build cross-compiles from ubuntu-latest using Wine - Arch build disabled (commented out) - Release action switched to actions/forgejo-release@v2 - Removed arch artifacts from release Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 118 ++++++++++++++++------------------ 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2648e63..1fc61dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,15 +8,23 @@ on: jobs: build-windows: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install Wine for cross-compilation + run: | + sudo dpkg --add-architecture i386 + sudo mkdir -pm755 /etc/apt/keyrings + sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key + sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources + sudo apt-get update + sudo apt-get install -y --install-recommends winehq-stable - uses: actions/setup-node@v4 with: node-version: '22' cache: 'npm' - run: npm ci - + - name: Build Windows Packages run: npx electron-builder --win --publish never - uses: actions/upload-artifact@v4 @@ -84,59 +92,46 @@ jobs: dist/*.rpm dist/latest-linux.yml - build-arch: - runs-on: ubuntu-latest - container: - image: archlinux:latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install base packages - run: | - pacman -Syu --noconfirm - pacman -S --noconfirm \ - base-devel \ - git \ - nodejs \ - npm \ - rpm-tools \ - libxcrypt-compat - - - name: Create build user - run: | - useradd -m builder - echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - - - name: Fix Permissions - run: chown -R builder:builder . - - - name: Build Arch Package - run: | - sudo -u builder bash << 'EOF' - set -e - makepkg --printsrcinfo > .SRCINFO - makepkg -s --noconfirm - EOF - - - name: Fix permissions for upload - if: always() - run: | - sudo chown -R $(id -u):$(id -g) . - - - name: Upload Arch Package - uses: actions/upload-artifact@v4 - with: - name: arch-package - path: | - *.pkg.tar.zst - .SRCINFO - include-hidden-files: true + # build-arch: + # runs-on: ubuntu-latest + # container: + # image: archlinux:latest + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # - name: Install base packages + # run: | + # pacman -Syu --noconfirm + # pacman -S --noconfirm base-devel git nodejs npm rpm-tools libxcrypt-compat + # - name: Create build user + # run: | + # useradd -m builder + # echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + # - name: Fix Permissions + # run: chown -R builder:builder . + # - name: Build Arch Package + # run: | + # sudo -u builder bash << 'EOF' + # set -e + # makepkg --printsrcinfo > .SRCINFO + # makepkg -s --noconfirm + # EOF + # - name: Fix permissions for upload + # if: always() + # run: sudo chown -R $(id -u):$(id -g) . + # - name: Upload Arch Package + # uses: actions/upload-artifact@v4 + # with: + # name: arch-package + # path: | + # *.pkg.tar.zst + # .SRCINFO + # include-hidden-files: true release: - needs: [build-windows, build-macos, build-linux, build-arch] + needs: [build-windows, build-macos, build-linux] runs-on: ubuntu-latest if: | startsWith(github.ref, 'refs/tags/v') || @@ -163,16 +158,13 @@ jobs: run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - name: Create Release - uses: softprops/action-gh-release@v2 + uses: actions/forgejo-release@v2 with: - tag_name: ${{ github.ref_name }} - files: | - artifacts/arch-package/*.pkg.tar.zst - artifacts/arch-package/.SRCINFO - artifacts/linux-builds/**/* - artifacts/windows-builds/**/* - artifacts/macos-builds/**/* - generate_release_notes: true - draft: true + tag: ${{ github.ref_name }} + direction: upload + url: https://git.sanhost.net + token: ${{ secrets.RELEASE_TOKEN }} + release-dir: artifacts + release-notes: "Release ${{ github.ref_name }}" prerelease: false