Skip to content

Merge remote-tracking branch 'origin/main' #35

Merge remote-tracking branch 'origin/main'

Merge remote-tracking branch 'origin/main' #35

Workflow file for this run

name: Build Executable
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: windows
arch: x64
- os: macos-13 # Intel
platform: macos
arch: x64
- os: macos-14 # Apple Silicon
platform: macos
arch: arm64
- os: ubuntu-latest
platform: linux
arch: x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
# Linux 上 tkinter 不是默认装的,不装 pyinstaller 会打出一个开不了的包
- name: Install system Tk (Linux)
if: matrix.platform == 'linux'
run: sudo apt-get update && sudo apt-get install -y python3-tk
# pywebview 在 Linux 上走 GTK/WebKit
- name: Install WebKit (Linux)
if: matrix.platform == 'linux'
run: sudo apt-get install -y libgirepository1.0-dev gir1.2-webkit2-4.1 python3-gi
- name: Cache pip
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/Library/Caches/pip
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.arch }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
# .mo 是从 lang/source/*.json 生成的,不进版本库,打包前必须先编译出来
- name: Compile translations
run: python tools/lang_build.py
- name: Check translations
run: python tools/lang_check.py
- name: Build
run: pyinstaller --noconfirm LitematicaViewer.spec
- name: Package macOS app
if: matrix.platform == 'macos'
run: |
cd dist
hdiutil create -volname LitematicaViewer -srcfolder LitematicaViewer.app \
-ov -format UDZO LitematicaViewer-${{ matrix.arch }}.dmg
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: LitematicaViewer-${{ matrix.platform }}-${{ matrix.arch }}
path: |
dist/*.dmg
dist/LitematicaViewer