2022-03-31 03:08:15 +00:00
|
|
|
# This workflow will build a release-like distribution when manually dispatched
|
|
|
|
|
|
|
|
name: Build
|
|
|
|
|
2023-03-14 00:32:00 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2023-03-14 18:29:20 +00:00
|
|
|
- '.github/workflows/build.yml'
|
2023-03-14 00:32:00 +00:00
|
|
|
- 'setup.py'
|
|
|
|
- 'requirements.txt'
|
2024-03-12 21:27:17 +00:00
|
|
|
- '*.iss'
|
2023-03-14 00:32:00 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-03-14 18:29:20 +00:00
|
|
|
- '.github/workflows/build.yml'
|
2023-03-14 00:32:00 +00:00
|
|
|
- 'setup.py'
|
|
|
|
- 'requirements.txt'
|
2024-03-12 21:27:17 +00:00
|
|
|
- '*.iss'
|
2023-03-14 00:32:00 +00:00
|
|
|
workflow_dispatch:
|
2022-03-31 03:08:15 +00:00
|
|
|
|
2022-09-04 21:43:03 +00:00
|
|
|
env:
|
|
|
|
ENEMIZER_VERSION: 7.1
|
|
|
|
APPIMAGETOOL_VERSION: 13
|
|
|
|
|
2022-03-31 03:08:15 +00:00
|
|
|
jobs:
|
2022-03-31 20:58:57 +00:00
|
|
|
# build-release-macos: # LF volunteer
|
|
|
|
|
2024-11-29 19:49:36 +00:00
|
|
|
build-win: # RCs will still be built and signed by hand
|
2022-04-02 00:04:18 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2024-03-12 21:27:17 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-02 00:04:18 +00:00
|
|
|
- name: Install python
|
2024-03-12 21:27:17 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-04-02 00:04:18 +00:00
|
|
|
with:
|
2024-11-30 16:23:28 +00:00
|
|
|
python-version: '~3.12.7'
|
|
|
|
check-latest: true
|
2022-04-02 00:04:18 +00:00
|
|
|
- name: Download run-time dependencies
|
|
|
|
run: |
|
2022-09-04 21:43:03 +00:00
|
|
|
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
|
2022-04-02 00:04:18 +00:00
|
|
|
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
|
2024-06-14 06:47:47 +00:00
|
|
|
choco install innosetup --version=6.2.2 --allow-downgrade
|
2022-04-02 00:04:18 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-03-25 18:54:42 +00:00
|
|
|
python -m pip install --upgrade pip
|
2022-10-28 17:13:09 +00:00
|
|
|
python setup.py build_exe --yes
|
2024-06-12 16:55:48 +00:00
|
|
|
if ( $? -eq $false ) {
|
|
|
|
Write-Error "setup.py failed!"
|
|
|
|
exit 1
|
|
|
|
}
|
2023-07-04 17:12:43 +00:00
|
|
|
$NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
|
2022-04-02 00:04:18 +00:00
|
|
|
$ZIP_NAME="Archipelago_$NAME.7z"
|
2023-07-04 17:12:43 +00:00
|
|
|
echo "$NAME -> $ZIP_NAME"
|
2022-04-02 00:04:18 +00:00
|
|
|
echo "ZIP_NAME=$ZIP_NAME" >> $Env:GITHUB_ENV
|
|
|
|
New-Item -Path dist -ItemType Directory -Force
|
|
|
|
cd build
|
2023-07-04 17:12:43 +00:00
|
|
|
Rename-Item "exe.$NAME" Archipelago
|
2022-04-02 00:04:18 +00:00
|
|
|
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
|
2024-03-12 21:27:17 +00:00
|
|
|
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
|
2024-06-12 16:55:48 +00:00
|
|
|
- name: Check build loads expected worlds
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build/exe*
|
|
|
|
mv Players/Templates/meta.yaml .
|
|
|
|
ls -1 Players/Templates | sort > setup-player-templates.txt
|
|
|
|
rm -R Players/Templates
|
|
|
|
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
|
|
|
|
ls -1 Players/Templates | sort > generated-player-templates.txt
|
|
|
|
cmp setup-player-templates.txt generated-player-templates.txt \
|
|
|
|
|| diff setup-player-templates.txt generated-player-templates.txt
|
|
|
|
mv meta.yaml Players/Templates/
|
|
|
|
- name: Test Generate
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build/exe*
|
|
|
|
cp Players/Templates/Clique.yaml Players/
|
|
|
|
timeout 30 ./ArchipelagoGenerate
|
|
|
|
- name: Store 7z
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ env.ZIP_NAME }}
|
|
|
|
path: dist/${{ env.ZIP_NAME }}
|
|
|
|
compression-level: 0 # .7z is incompressible by zip
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 7 # keep for 7 days, should be enough
|
2024-03-12 21:27:17 +00:00
|
|
|
- name: Store Setup
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ env.SETUP_NAME }}
|
|
|
|
path: setups/${{ env.SETUP_NAME }}
|
2024-06-12 16:55:48 +00:00
|
|
|
if-no-files-found: error
|
2024-03-12 21:27:17 +00:00
|
|
|
retention-days: 7 # keep for 7 days, should be enough
|
2022-04-02 00:04:18 +00:00
|
|
|
|
2023-03-13 23:04:34 +00:00
|
|
|
build-ubuntu2004:
|
|
|
|
runs-on: ubuntu-20.04
|
2022-03-31 03:08:15 +00:00
|
|
|
steps:
|
2022-09-04 21:43:03 +00:00
|
|
|
# - copy code below to release.yml -
|
2024-03-13 07:25:51 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-03-31 03:08:15 +00:00
|
|
|
- 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
|
2024-03-13 07:25:51 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-03-31 03:08:15 +00:00
|
|
|
with:
|
2024-11-30 16:23:28 +00:00
|
|
|
python-version: '~3.12.7'
|
|
|
|
check-latest: true
|
2022-03-31 03:08:15 +00:00
|
|
|
- name: Install build-time dependencies
|
|
|
|
run: |
|
2024-11-29 19:07:14 +00:00
|
|
|
echo "PYTHON=python3.12" >> $GITHUB_ENV
|
2022-09-04 21:43:03 +00:00
|
|
|
wget -nv https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
|
2022-03-31 03:08:15 +00:00
|
|
|
chmod a+rx appimagetool-x86_64.AppImage
|
|
|
|
./appimagetool-x86_64.AppImage --appimage-extract
|
|
|
|
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
|
|
|
|
chmod a+rx appimagetool
|
|
|
|
- name: Download run-time dependencies
|
|
|
|
run: |
|
2022-09-04 21:43:03 +00:00
|
|
|
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
|
2022-03-31 03:08:15 +00:00
|
|
|
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-04-02 00:04:18 +00:00
|
|
|
# pygobject is an optional dependency for kivy that's not in requirements
|
2023-02-07 08:09:43 +00:00
|
|
|
# charset-normalizer was somehow incomplete in the github runner
|
2022-03-31 03:08:15 +00:00
|
|
|
"${{ env.PYTHON }}" -m venv venv
|
|
|
|
source venv/bin/activate
|
2023-03-25 18:54:42 +00:00
|
|
|
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject charset-normalizer
|
2022-10-28 17:13:09 +00:00
|
|
|
python setup.py build_exe --yes bdist_appimage --yes
|
2022-03-31 03:08:15 +00:00
|
|
|
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"
|
2024-06-12 16:55:48 +00:00
|
|
|
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
|
2022-03-31 03:08:15 +00:00
|
|
|
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
|
|
|
|
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
|
2022-09-04 21:43:03 +00:00
|
|
|
# - copy code above to release.yml -
|
2023-03-25 23:54:56 +00:00
|
|
|
- name: Build Again
|
|
|
|
run: |
|
|
|
|
source venv/bin/activate
|
|
|
|
python setup.py build_exe --yes
|
2024-06-12 16:55:48 +00:00
|
|
|
- name: Check build loads expected worlds
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build/exe*
|
|
|
|
mv Players/Templates/meta.yaml .
|
|
|
|
ls -1 Players/Templates | sort > setup-player-templates.txt
|
|
|
|
rm -R Players/Templates
|
|
|
|
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
|
|
|
|
ls -1 Players/Templates | sort > generated-player-templates.txt
|
|
|
|
cmp setup-player-templates.txt generated-player-templates.txt \
|
|
|
|
|| diff setup-player-templates.txt generated-player-templates.txt
|
|
|
|
mv meta.yaml Players/Templates/
|
|
|
|
- name: Test Generate
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build/exe*
|
|
|
|
cp Players/Templates/Clique.yaml Players/
|
|
|
|
timeout 30 ./ArchipelagoGenerate
|
2022-03-31 03:08:15 +00:00
|
|
|
- name: Store AppImage
|
2024-03-13 07:25:51 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-03-31 03:08:15 +00:00
|
|
|
with:
|
|
|
|
name: ${{ env.APPIMAGE_NAME }}
|
|
|
|
path: dist/${{ env.APPIMAGE_NAME }}
|
2024-06-12 16:55:48 +00:00
|
|
|
if-no-files-found: error
|
2022-04-02 00:04:18 +00:00
|
|
|
retention-days: 7
|
2022-03-31 03:08:15 +00:00
|
|
|
- name: Store .tar.gz
|
2024-03-13 07:25:51 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-03-31 03:08:15 +00:00
|
|
|
with:
|
|
|
|
name: ${{ env.TAR_NAME }}
|
|
|
|
path: dist/${{ env.TAR_NAME }}
|
2024-06-12 16:55:48 +00:00
|
|
|
compression-level: 0 # .gz is incompressible by zip
|
|
|
|
if-no-files-found: error
|
2022-04-02 00:04:18 +00:00
|
|
|
retention-days: 7
|