mirror of
https://github.com/Horizontal42/warehouse-master.git
synced 2026-11-11 01:22:00 +03:00
add cross-platform CI build workflow
This commit is contained in:
parent
08c87e1c37
commit
28c834585d
1 changed files with 84 additions and 0 deletions
84
.github/workflows/build.yml
vendored
Normal file
84
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Release tag to upload assets to'
|
||||||
|
required: true
|
||||||
|
default: 'v1.0.0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tag: ${{ steps.tag.outputs.value }}
|
||||||
|
steps:
|
||||||
|
- name: Resolve tag
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
echo "value=${{ inputs.tag }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "value=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Ensure release exists
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh release view "${{ steps.tag.outputs.value }}" --repo "${{ github.repository }}" 2>/dev/null || \
|
||||||
|
gh release create "${{ steps.tag.outputs.value }}" \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--title "${{ steps.tag.outputs.value }}" \
|
||||||
|
--generate-notes
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: create-release
|
||||||
|
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: gh release upload "${{ needs.create-release.outputs.tag }}" "dist/${{ matrix.artifact }}" --clobber
|
||||||
Loading…
Add table
Reference in a new issue