-
-
Notifications
You must be signed in to change notification settings - Fork 24
77 lines (66 loc) · 2.88 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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