Compile Binaries #88
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: Compile Binaries | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
env: | |
bin: ${{ matrix.os == 'macos-latest' && './temp/darwin/catw' || matrix.os == 'windows-latest' && './temp/windows/catw.exe' || './temp/linux/catw' }} | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: 'dev' | |
- name: Install Python 3.10 | |
id: python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Update PIP | |
run: | | |
python -m pip install --upgrade pip | |
- name: Setup Compile Dependencies | |
run: | | |
python -m pip install --upgrade pyinstaller | |
- name: Setup Code Dependencies | |
run: | | |
python -m pip install --upgrade -r ./workflowHelper/requirements.txt | |
- name: Setup Version File | |
run: | | |
python -m workflowHelper.exeversion | |
- name: Compile Package | |
run: | | |
python -m workflowHelper.build | |
- name: Test Executable ${{ matrix.os }} | |
run: | | |
${{ env.bin }} -h | |
${{ env.bin }} -v | |
${{ env.bin }} -p ${{ env.bin }} -R --debug | |
- name: Show Changes | |
run: | | |
git status | |
- name: Stash Changes | |
run: | | |
git config --local user.name 'github-actions[bot]' | |
git config --local user.email 'github-actions[bot]@users.noreply.github.com' | |
git add ./temp/* | |
git stash -- temp | |
git clean -df | |
git restore . | |
- name: Fetch Binaries Branch | |
run: | | |
git fetch origin binaries | |
git checkout binaries | |
git stash pop | |
- name: Copy To Bin | |
run: | | |
python -c "import sys; import shutil; shutil.copytree('./temp', './bin', dirs_exist_ok=True)" | |
- name: Commit & Push | |
run: | | |
git add ./bin/* | |
git reset ./temp/* | |
git status | |
git commit -m "🤖Compiled Binary for ${{ matrix.os }}." | |
git push origin HEAD:binaries | |
continue-on-error: true |