mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 05:41:48 -03:00
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:
118
.github/workflows/release.yml
vendored
118
.github/workflows/release.yml
vendored
@@ -8,15 +8,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- name: Build Windows Packages
|
- name: Build Windows Packages
|
||||||
run: npx electron-builder --win --publish never
|
run: npx electron-builder --win --publish never
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
@@ -84,59 +92,46 @@ jobs:
|
|||||||
dist/*.rpm
|
dist/*.rpm
|
||||||
dist/latest-linux.yml
|
dist/latest-linux.yml
|
||||||
|
|
||||||
build-arch:
|
# build-arch:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
container:
|
# container:
|
||||||
image: archlinux:latest
|
# image: archlinux:latest
|
||||||
steps:
|
# steps:
|
||||||
- name: Checkout repository
|
# - name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
# uses: actions/checkout@v4
|
||||||
with:
|
# with:
|
||||||
fetch-depth: 0
|
# fetch-depth: 0
|
||||||
|
# - name: Install base packages
|
||||||
- name: Install base packages
|
# run: |
|
||||||
run: |
|
# pacman -Syu --noconfirm
|
||||||
pacman -Syu --noconfirm
|
# pacman -S --noconfirm base-devel git nodejs npm rpm-tools libxcrypt-compat
|
||||||
pacman -S --noconfirm \
|
# - name: Create build user
|
||||||
base-devel \
|
# run: |
|
||||||
git \
|
# useradd -m builder
|
||||||
nodejs \
|
# echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
npm \
|
# - name: Fix Permissions
|
||||||
rpm-tools \
|
# run: chown -R builder:builder .
|
||||||
libxcrypt-compat
|
# - name: Build Arch Package
|
||||||
|
# run: |
|
||||||
- name: Create build user
|
# sudo -u builder bash << 'EOF'
|
||||||
run: |
|
# set -e
|
||||||
useradd -m builder
|
# makepkg --printsrcinfo > .SRCINFO
|
||||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
# makepkg -s --noconfirm
|
||||||
|
# EOF
|
||||||
- name: Fix Permissions
|
# - name: Fix permissions for upload
|
||||||
run: chown -R builder:builder .
|
# if: always()
|
||||||
|
# run: sudo chown -R $(id -u):$(id -g) .
|
||||||
- name: Build Arch Package
|
# - name: Upload Arch Package
|
||||||
run: |
|
# uses: actions/upload-artifact@v4
|
||||||
sudo -u builder bash << 'EOF'
|
# with:
|
||||||
set -e
|
# name: arch-package
|
||||||
makepkg --printsrcinfo > .SRCINFO
|
# path: |
|
||||||
makepkg -s --noconfirm
|
# *.pkg.tar.zst
|
||||||
EOF
|
# .SRCINFO
|
||||||
|
# include-hidden-files: true
|
||||||
- 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:
|
release:
|
||||||
needs: [build-windows, build-macos, build-linux, build-arch]
|
needs: [build-windows, build-macos, build-linux]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: |
|
if: |
|
||||||
startsWith(github.ref, 'refs/tags/v') ||
|
startsWith(github.ref, 'refs/tags/v') ||
|
||||||
@@ -163,16 +158,13 @@ jobs:
|
|||||||
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: actions/forgejo-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag: ${{ github.ref_name }}
|
||||||
files: |
|
direction: upload
|
||||||
artifacts/arch-package/*.pkg.tar.zst
|
url: https://git.sanhost.net
|
||||||
artifacts/arch-package/.SRCINFO
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
artifacts/linux-builds/**/*
|
release-dir: artifacts
|
||||||
artifacts/windows-builds/**/*
|
release-notes: "Release ${{ github.ref_name }}"
|
||||||
artifacts/macos-builds/**/*
|
|
||||||
generate_release_notes: true
|
|
||||||
draft: true
|
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user