2022-03-31 03:08:15 +00:00
|
|
|
# This workflow will build a release-like distribution when manually dispatched
|
|
|
|
|
|
|
|
name: Build
|
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
2022-09-04 21:43:03 +00:00
|
|
|
env:
|
2023-02-07 07:53:21 +00:00
|
|
|
SNI_VERSION: v0.0.88
|
2022-09-04 21:43:03 +00:00
|
|
|
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
|
|
|
|
|
2022-04-02 00:04:18 +00:00
|
|
|
build-win-py38: # RCs will still be built and signed by hand
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install python
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
with:
|
|
|
|
python-version: '3.8'
|
|
|
|
- name: Download run-time dependencies
|
|
|
|
run: |
|
2022-09-04 21:43:03 +00:00
|
|
|
Invoke-WebRequest -Uri https://github.com/alttpo/sni/releases/download/${Env:SNI_VERSION}/sni-${Env:SNI_VERSION}-windows-amd64.zip -OutFile sni.zip
|
2022-04-02 00:04:18 +00:00
|
|
|
Expand-Archive -Path sni.zip -DestinationPath SNI -Force
|
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
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-06-16 19:13:45 +00:00
|
|
|
python -m pip install --upgrade pip setuptools
|
2022-04-02 00:04:18 +00:00
|
|
|
pip install -r requirements.txt
|
2022-10-28 17:13:09 +00:00
|
|
|
python setup.py build_exe --yes
|
2022-04-02 00:04:18 +00:00
|
|
|
$NAME="$(ls build)".Split('.',2)[1]
|
|
|
|
$ZIP_NAME="Archipelago_$NAME.7z"
|
|
|
|
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
|
|
|
|
- name: Store 7z
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ env.ZIP_NAME }}
|
|
|
|
path: dist/${{ env.ZIP_NAME }}
|
|
|
|
retention-days: 7 # keep for 7 days, should be enough
|
|
|
|
|
2022-03-31 03:08:15 +00:00
|
|
|
build-ubuntu1804:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
2022-09-04 21:43:03 +00:00
|
|
|
# - copy code below to release.yml -
|
2022-03-31 03:08:15 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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@v3
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Install build-time dependencies
|
|
|
|
run: |
|
|
|
|
echo "PYTHON=python3.9" >> $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/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz
|
2022-03-31 03:08:15 +00:00
|
|
|
tar xf sni-*.tar.xz
|
|
|
|
rm sni-*.tar.xz
|
|
|
|
mv sni-* SNI
|
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-02-07 08:09:43 +00:00
|
|
|
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject setuptools charset-normalizer
|
2022-03-31 03:08:15 +00:00
|
|
|
pip install -r requirements.txt
|
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"
|
|
|
|
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
|
|
|
|
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 -
|
2022-03-31 03:08:15 +00:00
|
|
|
- name: Store AppImage
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ env.APPIMAGE_NAME }}
|
|
|
|
path: dist/${{ env.APPIMAGE_NAME }}
|
2022-04-02 00:04:18 +00:00
|
|
|
retention-days: 7
|
2022-03-31 03:08:15 +00:00
|
|
|
- name: Store .tar.gz
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ env.TAR_NAME }}
|
|
|
|
path: dist/${{ env.TAR_NAME }}
|
2022-04-02 00:04:18 +00:00
|
|
|
retention-days: 7
|