Repository navigation
114 lines (95 loc) · 3.68 KB
/
Copy pathrelease.yml
File metadata and controls
114 lines (95 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release
on:
push:
tags:
- '*'
release:
types: [published, created]
workflow_dispatch:
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
env:
QT_QPA_PLATFORM: offscreen
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt pyinstaller
- name: Run test suite
run: python -m pytest -q
- name: Build standalone executable
run: python build.py
- name: Package standalone ZIP
shell: powershell
run: |
$Version = if ($env:GITHUB_REF_NAME) { $env:GITHUB_REF_NAME } else { "v0.1.0" }
$ZipName = "UnityLocalizer-${Version}-windows-x64.zip"
Compress-Archive -Path "dist\UnityLocalizer\*" -DestinationPath $ZipName -CompressionLevel Optimal
echo "ZIP_PATH=$ZipName" >> $env:GITHUB_ENV
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: UnityLocalizer-windows-x64
path: ${{ env.ZIP_PATH }}
- name: Attach to GitHub Release
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ZIP_PATH }}
generate_release_notes: true
build-linux:
# Experimental. Built on an older Ubuntu so the binary runs on current distributions and
# SteamOS (glibc is forward-compatible only). The job fails, and nothing is attached to the
# release, unless the frozen program passes its own self-check and an offscreen start-up.
runs-on: ubuntu-22.04
env:
QT_QPA_PLATFORM: offscreen
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: System libraries for Qt and fonts
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libxkbcommon0 libxkbcommon-x11-0 libdbus-1-3 libfontconfig1 libglib2.0-0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xkb1 fonts-dejavu-core fonts-liberation fontconfig
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt pyinstaller
- name: Build standalone executable (runs the frozen self-check)
run: python build.py
- name: Start-up smoke test of the frozen program
env:
UNITYLOCALIZER_SMOKE_TEST: "1"
run: timeout 90 ./dist/UnityLocalizer/UnityLocalizer
- name: Package tar.gz (keeps the executable bit)
run: |
VERSION="${GITHUB_REF_NAME:-dev}"
TAR_NAME="UnityLocalizer-${VERSION//\//-}-linux-x64.tar.gz"
tar -czf "$TAR_NAME" -C dist UnityLocalizer
echo "TAR_PATH=$TAR_NAME" >> "$GITHUB_ENV"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: UnityLocalizer-linux-x64
path: ${{ env.TAR_PATH }}
- name: Attach to GitHub Release
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: ${{ env.TAR_PATH }}
generate_release_notes: true