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 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-02-20 00:54:58 +01:00
parent b93dc027e1
commit 3abe885ab4

View File

@@ -8,9 +8,17 @@ 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'
@@ -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