Update build-binary.yml #92
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: Python application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3.6.0 | |
- name: Set up Python | |
#due to github actions building their own python distribution, downloading and installing the official release is required for 10.9 support | |
run: | | |
wget https://www.python.org/ftp/python/3.9.13/python-3.9.13-macosx10.9.pkg | |
sudo installer -pkg python-3.9.13-macosx10.9.pkg -target / | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --break-system-packages --upgrade pip | |
pip3 --break-system-packages install requests pyinstaller | |
npm install -g pkg | |
- name: Create Asar Binary | |
run: | | |
npm pack @electron/asar@3.2.3 | |
tar -xzf ./electron-asar-3.2.3.tgz | |
mv ./support/package.json ./package/package.json | |
cd package | |
npm install . | |
cd /Users/runner/work/Discord-Legacy-Patcher/Discord-Legacy-Patcher/ | |
pkg ./package/package.json --target node10-macos-x64 --compress GZip | |
mkdir files | |
mv ./asar ./files/asar | |
- name: Create PyInstaller Binary | |
run: | | |
python3 ./support/build.py | |
- name: Codesign Binary | |
run: | | |
codesign --force --deep -s - ./dist/Discord\ Legacy | |
chmod +x ./dist/Discord\ Legacy | |
- name: Upload Binary to Actions | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: Discord Legacy | |
path: ./dist/Discord\ Legacy | |
- name: Package Binary for Release | |
if: github.event_name == 'release' | |
run: | | |
mkdir releasefolder | |
zip Discord\ Legacy.zip ./dist/Discord\ Legacy | |
- name: Upload Binary to Release | |
if: github.event_name == 'release' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: Discord Legacy.zip | |
tag: ${{ github.ref }} |