Build multiplatform #388
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: Build multiplatform | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: Release git tag | |
type: string | |
required: true | |
push: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Windows | |
os: windows-latest | |
artifactsPath: ./src/dist/*.exe | |
- name: Linux | |
os: ubuntu-20.04 | |
artifactsPath: ./src/dist/*.AppImage | |
- name: Windows_dir | |
os: windows-latest | |
artifactsPath: ./src/dist/*.zip | |
- name: Linux_dir | |
os: ubuntu-20.04 | |
artifactsPath: ./src/dist/*.zip | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11.5" | |
- name: Install dependencies Linux | |
if: startsWith(matrix.name, 'Linux' ) | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests patool screeninfo packaging wmi GPUtil psutil pyinstaller https://github.com/MaxLastBreath/ttkbootstrapFIX/zipball/master | |
- name: Install dependencies Windows | |
if: startsWith(matrix.name, 'Windows' ) | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests patool screeninfo packaging wmi GPUtil psutil pyinstaller https://github.com/MaxLastBreath/ttkbootstrapFIX/zipball/master | |
- name: Build ${{ matrix.name }} | |
run: | | |
cd ./src/ | |
python ./compile_onedir.py --version ${{ inputs.tag }} | |
if: endsWith(matrix.name, 'dir') | |
- name: Build ${{ matrix.name }} | |
run: | | |
cd ./src/ | |
python ./compile.py --version ${{ inputs.tag }} | |
if: endsWith(matrix.name, 'dir') == false | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts-${{ matrix.name }} | |
path: ./src/dist | |
- name: Publish release | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ${{ matrix.artifactsPath }} | |
tag: ${{ inputs.tag }} | |
name: TOTK Optimizer ${{ inputs.tag }} | |
allowUpdates: true | |
artifactErrorsFailBuild: false | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} |