All Platform Build #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: All Platform Build | |
on: | |
workflow_dispatch: | |
release: | |
types: [released] | |
#push: | |
# branches: | |
# - master | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-20.04, macos-12] | |
steps: | |
- name: Repo Checkout | |
uses: actions/checkout@main | |
with: | |
lfs: true | |
- name: Setup Python | |
uses: actions/setup-python@main | |
with: | |
python-version: '3.12' # PyInstaller supports up to 3.12 | |
- name: Get Dependencies and PyInstaller | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade wheel | |
pip install --upgrade -r requirements.txt | |
pip install pyinstaller==6.10.0 | |
# Windows Defender is throwing false-positive matches | |
#- name: Build PyInstaller Bootloader | |
# if: ${{ runner.os == 'Windows' }} | |
# run: | | |
# git clone https://github.com/pyinstaller/pyinstaller.git --depth 1 --branch "v6.10.0" | |
# cd pyinstaller/bootloader | |
# python ./waf all | |
# rm -r "$(python -c "import os, sys; print(os.path.dirname(sys.executable))")/Lib/site-packages/PyInstaller/bootloader" | |
# cp -r "../PyInstaller/bootloader" "$(python -c "import os, sys; print(os.path.dirname(sys.executable))")/Lib/site-packages/PyInstaller" | |
- name: Install Tkinter | |
if: ${{ runner.os == 'macOS' }} | |
run: brew install [email protected] && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc | |
- name: PyInstaller Build | |
run: ${{ runner.os == 'Windows' && 'iex ' || ''}}$(cat pyinstaller_${{ runner.os == 'Windows' && 'windows' || runner.os == 'Linux' && 'linux' || 'macos' }}.txt) | |
- name: PyInstaller Build (ZIP) | |
if: ${{ runner.os == 'Windows' }} | |
run: Compress-Archive "dist/GModCEFCodecFix" "GModCEFCodecFix.zip" | |
- name: Get Latest Release Info | |
id: latest-release | |
uses: actions/github-script@main | |
with: | |
script: | | |
return github.rest.repos.getLatestRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}) | |
# TODO: Use https://github.com/softprops/action-gh-release instead (is it drop-in or do we have to do stuff?) | |
- name: Upload Release Binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ fromJSON(steps.latest-release.outputs.result).data.upload_url }} | |
asset_path: ./dist/GModCEFCodecFix${{ runner.os == 'Windows' && '.zip' || '' }} | |
asset_name: GModCEFCodecFix-${{ runner.os }}${{ runner.os == 'Windows' && '.zip' || '' }} | |
asset_content_type: application/octet-stream |