warehouse-master/.github/workflows/build.yml

67 lines
1.6 KiB
YAML

name: build
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to upload assets to'
required: true
default: 'v1.0.0'
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact: WarehouseMaster.exe
- os: macos-latest
artifact: WarehouseMaster-macos
- os: ubuntu-latest
artifact: WarehouseMaster-linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y libxcb-xinerama0 libgl1 libegl1
- name: Install Python deps
run: pip install pyinstaller -r requirements.txt
- name: Build
env:
QT_QPA_PLATFORM: offscreen
run: pyinstaller WarehouseMaster.spec
- name: Rename artifact (macOS/Linux)
if: runner.os != 'Windows'
shell: bash
run: mv dist/WarehouseMaster "dist/${{ matrix.artifact }}"
- name: Upload to release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name }}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ inputs.tag }}"
fi
gh release upload "$TAG" "dist/${{ matrix.artifact }}" --clobber