mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-05-20 15:11:46 -07:00
d41cec6494
The update will be required once GH drops support for Node 20. Also enables new options the action has now.
181 lines
7.5 KiB
YAML
181 lines
7.5 KiB
YAML
# This workflow will create a release and store builds to it when an x.y.z tag is pushed
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v?[0-9]+.[0-9]+.[0-9]*'
|
|
|
|
env:
|
|
ENEMIZER_VERSION: 7.1
|
|
# NOTE: since appimage/appimagetool and appimage/type2-runtime does not have tags anymore,
|
|
# we check the sha256 and require manual intervention if it was updated.
|
|
APPIMAGE_FORK: 'PopTracker'
|
|
APPIMAGETOOL_VERSION: 'r-2025-11-18'
|
|
APPIMAGETOOL_X86_64_HASH: '4577a452b30af2337123fbb383aea154b618e51ad5448c3b62085cbbbfbfd9a2'
|
|
APPIMAGE_RUNTIME_VERSION: 'r-2025-11-07'
|
|
APPIMAGE_RUNTIME_X86_64_HASH: '27ddd3f78e483fc5f7856e413d7c17092917f8c35bfe3318a0d378aa9435ad17'
|
|
|
|
permissions: # permissions required for attestation
|
|
id-token: 'write'
|
|
attestations: 'write'
|
|
contents: 'write' # additionally required for release
|
|
|
|
jobs:
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set env
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # tag x.y.z will become "Archipelago x.y.z"
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
|
with:
|
|
draft: true # don't publish right away, especially since windows build is added by hand
|
|
prerelease: false
|
|
name: Archipelago ${{ env.RELEASE_VERSION }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# build-release-macos: # LF volunteer
|
|
|
|
build-release-win:
|
|
runs-on: windows-latest
|
|
if: ${{ true }} # change to false to skip if release is built by hand
|
|
needs: create-release
|
|
steps:
|
|
- name: Set env
|
|
shell: bash
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
# - code below copied from build.yml -
|
|
- uses: actions/checkout@v6.0.2
|
|
- name: Install python
|
|
uses: actions/setup-python@v6.2.0
|
|
with:
|
|
python-version: '~3.12.7'
|
|
check-latest: true
|
|
- name: Download run-time dependencies
|
|
run: |
|
|
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
|
|
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
|
|
choco install innosetup --version=6.2.2 --allow-downgrade
|
|
- name: Build
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python setup.py build_exe --yes
|
|
if ( $? -eq $false ) {
|
|
Write-Error "setup.py failed!"
|
|
exit 1
|
|
}
|
|
$NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
|
|
$ZIP_NAME="Archipelago_$NAME.7z"
|
|
echo "$NAME -> $ZIP_NAME"
|
|
echo "ZIP_NAME=$ZIP_NAME" >> $Env:GITHUB_ENV
|
|
New-Item -Path dist -ItemType Directory -Force
|
|
cd build
|
|
Rename-Item "exe.$NAME" Archipelago
|
|
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
|
|
Rename-Item Archipelago "exe.$NAME" # inno_setup.iss expects the original name
|
|
- name: Build Setup
|
|
run: |
|
|
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" inno_setup.iss /DNO_SIGNTOOL
|
|
if ( $? -eq $false ) {
|
|
Write-Error "Building setup failed!"
|
|
exit 1
|
|
}
|
|
$contents = Get-ChildItem -Path setups/*.exe -Force -Recurse
|
|
$SETUP_NAME=$contents[0].Name
|
|
echo "SETUP_NAME=$SETUP_NAME" >> $Env:GITHUB_ENV
|
|
# - code above copied from build.yml -
|
|
- name: Attest Build
|
|
uses: actions/attest@v4.1.0
|
|
with:
|
|
subject-path: |
|
|
build/exe.*/ArchipelagoLauncher.exe
|
|
build/exe.*/ArchipelagoLauncherDebug.exe
|
|
build/exe.*/ArchipelagoGenerate.exe
|
|
build/exe.*/ArchipelagoServer.exe
|
|
setups/*
|
|
- name: Add to Release
|
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
|
with:
|
|
draft: true # see above
|
|
prerelease: false
|
|
name: Archipelago ${{ env.RELEASE_VERSION }}
|
|
files: |
|
|
setups/*
|
|
fail_on_unmatched_files: true
|
|
overwrite_files: false # Windows release is usually built by hand
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-release-ubuntu2204:
|
|
runs-on: ubuntu-22.04
|
|
needs: create-release
|
|
steps:
|
|
- name: Set env
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
# - code below copied from build.yml -
|
|
- uses: actions/checkout@v6.0.2
|
|
- name: Install base dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
|
|
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
|
|
- name: Get a recent python
|
|
uses: actions/setup-python@v6.2.0
|
|
with:
|
|
python-version: '~3.12.7'
|
|
check-latest: true
|
|
- name: Install build-time dependencies
|
|
run: |
|
|
echo "PYTHON=python3.12" >> $GITHUB_ENV
|
|
wget -nv https://github.com/$APPIMAGE_FORK/appimagetool/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
|
|
echo "$APPIMAGETOOL_X86_64_HASH appimagetool-x86_64.AppImage" | sha256sum -c
|
|
wget -nv https://github.com/$APPIMAGE_FORK/type2-runtime/releases/download/$APPIMAGE_RUNTIME_VERSION/runtime-x86_64
|
|
echo "$APPIMAGE_RUNTIME_X86_64_HASH runtime-x86_64" | sha256sum -c
|
|
chmod a+rx appimagetool-x86_64.AppImage
|
|
./appimagetool-x86_64.AppImage --appimage-extract
|
|
echo -e '#/bin/sh\n./squashfs-root/AppRun --runtime-file runtime-x86_64 "$@"' > appimagetool
|
|
chmod a+rx appimagetool
|
|
- name: Download run-time dependencies
|
|
run: |
|
|
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
|
|
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
|
|
- name: Build
|
|
run: |
|
|
# pygobject is an optional dependency for kivy that's not in requirements
|
|
# charset-normalizer was somehow incomplete in the github runner
|
|
"${{ env.PYTHON }}" -m venv venv
|
|
source venv/bin/activate
|
|
"${{ env.PYTHON }}" -m pip install --upgrade pip "PyGObject<3.51.0" charset-normalizer
|
|
python setup.py build_exe --yes bdist_appimage --yes
|
|
echo -e "setup.py build output:\n `ls build`"
|
|
echo -e "setup.py dist output:\n `ls dist`"
|
|
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
|
|
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
|
|
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
|
|
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
|
|
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
|
|
# - code above copied from build.yml -
|
|
- name: Attest Build
|
|
uses: actions/attest@v4.1.0
|
|
with:
|
|
subject-path: |
|
|
build/exe.*/ArchipelagoLauncher
|
|
build/exe.*/ArchipelagoGenerate
|
|
build/exe.*/ArchipelagoServer
|
|
dist/*
|
|
- name: Add to Release
|
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
|
with:
|
|
draft: true # see above
|
|
prerelease: false
|
|
name: Archipelago ${{ env.RELEASE_VERSION }}
|
|
files: |
|
|
dist/*
|
|
fail_on_unmatched_files: true
|
|
overwrite_files: false # should never happen; avoids accidentally changing a release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|