chore: Update build workflow to include Linux builds #47
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 }}-win.exe | |
- name: Compress Executable | |
run: Compress-Archive -Path StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-win.exe -DestinationPath StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-win.zip | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-${{ matrix.build_type }} | |
path: | | |
./StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-win.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/[email protected] | |
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 --macos-target-arch=${{ matrix.architecture }} --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: Remove quarantine attribute | |
run: xattr -dr com.apple.quarantine StreamLabsTikTokStreamKeyGenerator.app | |
- name: Rename Executable | |
run: mv StreamLabsTikTokStreamKeyGenerator.app StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}-macos.app | |
- name: Compress Executable | |
run: zip -r StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}-macos.zip StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}-macos.app | |
- name: Upload architecture-specific artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-${{ matrix.build_type }}-${{ matrix.architecture }} | |
path: StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-${{ matrix.architecture }}-macos.zip | |
build_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build_type: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Release variable | |
run: echo "Release=${{ matrix.build_type }}" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ccache python3-pip zip | |
python3 -m pip install --upgrade pip | |
pip3 install Nuitka | |
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi | |
- name: Configure ccache | |
run: | | |
export CCACHE_DIR=$HOME/.cache/ccache | |
export CC="ccache gcc" | |
export CXX="ccache g++" | |
export CCACHE_MAXSIZE="500M" | |
ccache --zero-stats | |
- name: Build Executable | |
run: | | |
if [ "$Release" == "Release" ]; then | |
ccache --show-stats | |
nuitka --standalone --onefile --follow-imports --include-data-dir=.seleniumwire=seleniumwire StreamLabsTikTokStreamKeyGenerator.py | |
ccache --show-stats | |
else | |
ccache --show-stats | |
nuitka --standalone --onefile --follow-imports --include-data-dir=.seleniumwire=seleniumwire StreamLabsTikTokStreamKeyGenerator.py | |
ccache --show-stats | |
fi | |
- name: Rename Executable | |
run: mv StreamLabsTikTokStreamKeyGenerator.bin StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-linux.bin | |
- name: Compress Executable | |
run: zip StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-linux.zip StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-linux.bin | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-${{ matrix.build_type }} | |
path: | | |
./StreamLabsTikTokStreamKeyGenerator${{ matrix.build_type }}-linux.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [build_windows, build_macos, build_linux] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Windows artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: windows-* | |
merge-multiple: true | |
path: ./windows | |
- name: Download MacOS artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: macos-* | |
merge-multiple: true | |
path: ./macos | |
- name: Download Linux artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: linux-* | |
merge-multiple: true | |
path: ./linux | |
- 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-win.zip | |
./windows/StreamLabsTikTokStreamKeyGeneratorDebug-win.zip | |
./macos/StreamLabsTikTokStreamKeyGeneratorRelease-x86_64-macos.zip | |
./macos/StreamLabsTikTokStreamKeyGeneratorDebug-x86_64-macos.zip | |
./macos/StreamLabsTikTokStreamKeyGeneratorRelease-arm64-macos.zip | |
./macos/StreamLabsTikTokStreamKeyGeneratorDebug-arm64-macos.zip | |
./linux/StreamLabsTikTokStreamKeyGeneratorRelease-linux.zip | |
./linux/StreamLabsTikTokStreamKeyGeneratorDebug-linux.zip |