chore: Attempt to fix MacOS build #40
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
FORCE_COLOR: true | |
jobs: | |
build_windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
build_type: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Release variable | |
run: | | |
$env:Release = '${{ matrix.build_type }}' | |
- name: Install sccache | |
run: choco install sccache -y | |
- name: Configure sccache | |
run: | | |
set SCCACHE_DIR=D:\a\StreamLabsTikTokStreamKeyGenerator\StreamLabsTikTokStreamKeyGenerator\.sccache | |
set SCCACHE_CACHE_SIZE=500M | |
set RUSTC_WRAPPER=sccache | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install Nuitka | |
if (Test-Path requirements.txt) { | |
pip install -r requirements.txt | |
} | |
- name: Build Executable | |
run: | | |
if ($env:Release -eq 'Release') { | |
sccache --show-stats | |
nuitka --windows-console-mode=disable --msvc=latest --assume-yes-for-downloads --onefile --follow-imports --enable-plugin=tk-inter --include-data-file=.seleniumwire/seleniumwire-ca.pem=seleniumwire/.seleniumwire/seleniumwire-ca.pem --include-data-file=.seleniumwire/seleniumwire-dhparam.pem=seleniumwire/.seleniumwire/seleniumwire-dhparam.pem StreamLabsTikTokStreamKeyGenerator.py | |
sccache --show-stats | |
} else { | |
sccache --show-stats | |
nuitka --msvc=latest --assume-yes-for-downloads --onefile --follow-imports --enable-plugin=tk-inter --include-data-file=.seleniumwire/seleniumwire-ca.pem=seleniumwire/.seleniumwire/seleniumwire-ca.pem --include-data-file=.seleniumwire/seleniumwire-dhparam.pem=seleniumwire/.seleniumwire/seleniumwire-dhparam.pem StreamLabsTikTokStreamKeyGenerator.py | |
sccache --show-stats | |
} | |
- name: Rename Executable | |
run: Rename-Item -Path StreamLabsTikTokStreamKeyGenerator.exe -NewName StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}.exe | |
- name: Compress Executable | |
run: Compress-Archive -Path StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}.exe -DestinationPath StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}.zip | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows | |
path: | | |
./StreamLabsTikTokStreamKeyGeneratorRelease.zip | |
./StreamLabsTikTokStreamKeyGeneratorDebug.zip | |
build_macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
architecture: [x86_64, arm64] | |
build_type: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up ccache | |
uses: hendrikmuhs/ccache-action@v1.2.14 | |
with: | |
create-symlink: true | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install Nuitka | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Build Executable | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
arch -${{ matrix.architecture }} nuitka --windows-console-mode=disable --assume-yes-for-downloads --standalone --macos-create-app-bundle --onefile --follow-imports --enable-plugin=tk-inter --include-data-file=.seleniumwire/seleniumwire-ca.pem=seleniumwire/.seleniumwire/seleniumwire-ca.pem --include-data-file=.seleniumwire/seleniumwire-dhparam.pem=seleniumwire/.seleniumwire/seleniumwire-dhparam.pem StreamLabsTikTokStreamKeyGenerator.py | |
- name: Rename Executable | |
run: mv StreamLabsTikTokStreamKeyGenerator.app StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}.app | |
- name: Compress Executable | |
run: zip -r StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}.zip StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}.app | |
- name: Upload architecture-specific artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-${{ matrix.build_type }}-${{ matrix.architecture }} | |
path: StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [build_windows, build_macos] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Windows artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows | |
path: ./windows | |
- name: Download MacOS x86_64 Release artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-Release-x86_64 | |
path: ./macos/x86_64 | |
- name: Download MacOS arm64 Release artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-Release-arm64 | |
path: ./macos/arm64 | |
- name: Download MacOS x86_64 Debug artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-Debug-x86_64 | |
path: ./macos/x86_64 | |
- name: Download MacOS arm64 Debug artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-Debug-arm64 | |
path: ./macos/arm64 | |
- name: Create the release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ github.ref_name }} | |
prerelease: ${{ github.event.inputs.prerelease }} | |
draft: false | |
files: | | |
./windows/StreamLabsTikTokStreamKeyGeneratorRelease.zip | |
./windows/StreamLabsTikTokStreamKeyGeneratorDebug.zip | |
./macos/x86_64/StreamLabsTikTokStreamKeyGeneratorRelease-x86_64.zip | |
./macos/x86_64/StreamLabsTikTokStreamKeyGeneratorDebug-x86_64.zip | |
./macos/arm64/StreamLabsTikTokStreamKeyGeneratorRelease-arm64.zip | |
./macos/arm64/StreamLabsTikTokStreamKeyGeneratorDebug-arm64.zip |