122 lines
2.9 KiB
YAML
122 lines
2.9 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "dev" ]
|
|
tags: [ "v*" ]
|
|
pull_request:
|
|
branches: [ "main", "dev" ]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
volumes:
|
|
- /tmp/act:/var/run/act
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install System Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libxkbcommon-x11-0 \
|
|
libxcb-icccm4 \
|
|
libxcb-image0 \
|
|
libxcb-keysyms1 \
|
|
libxcb-randr0 \
|
|
libxcb-render-util0 \
|
|
libxcb-xinerama0 \
|
|
libxcb-xinput0 \
|
|
libxcb-xfixes0 \
|
|
libxcb-shape0 \
|
|
libgl1 \
|
|
libegl1 \
|
|
libdbus-1-3 \
|
|
libx11-xcb1
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Build Executable
|
|
run: |
|
|
python build_app.py
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: TeletextEditor-Linux
|
|
path: dist/TeletextEditor_Linux
|
|
|
|
build-windows:
|
|
name: Build Windows
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: tobix/pywine:3.10
|
|
volumes:
|
|
- /tmp/act:/var/run/act
|
|
steps:
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get clean
|
|
apt-get update
|
|
apt-get install -y --fix-missing nodejs npm
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
wine python -m pip install --upgrade pip
|
|
wine pip install -r requirements.txt
|
|
|
|
- name: Build Executable
|
|
run: |
|
|
wine python build_app.py
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: TeletextEditor-Windows
|
|
path: dist/TeletextEditor_Windows.exe
|
|
|
|
release:
|
|
name: Create Release
|
|
needs: [build-linux, build-windows]
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Download Linux Artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: TeletextEditor-Linux
|
|
path: dist
|
|
|
|
- name: Download Windows Artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: TeletextEditor-Windows
|
|
path: dist
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
dist/TeletextEditor_Linux
|
|
dist/TeletextEditor_Windows.exe
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|