-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.21 KB
/
gui-release.yml
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
115
116
117
118
119
120
121
122
name: Create Release
on:
push:
branches-ignore:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
build-binaries:
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.2
- name: Get version tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install Linux dependencies
if: ${{ runner.os == 'Linux' }}
run: >
sudo apt-get install
'^libxcb.*-dev'
libx11-xcb-dev
libglu1-mesa-dev
libxrender-dev
libxi-dev
libxkbcommon-dev
libxkbcommon-x11-dev
- name: Install dependencies
run: |
poetry version ${{ env.tag }}
sed -i "s/0.0.0/${{ env.tag }}/g" las_trx/__init__.py
poetry run pip install --upgrade pip setuptools
poetry install
- name: Build Linux GUI Executable
if: ${{ runner.os == 'Linux' }}
run: >
poetry run pyinstaller
--onefile
--icon="las_trx/resources/las-trx.ico"
--add-data="las_trx/resources/las-trx.ico:resources"
--add-data="las_trx/resources/*.ui:resources"
--name LAS-TRX-v${{ env.tag }}-linux
las_trx/__main__.py
- name: Build Windows GUI Executable
if: ${{ runner.os == 'Windows' }}
run: >
poetry run pyinstaller
--onefile
--windowed
--icon="las_trx\resources\las-trx.ico"
--add-data="las_trx\resources\las-trx.ico;resources"
--add-data="las_trx\resources\*.ui;resources"
--name LAS-TRX-v${{ env.tag }}-win64.exe
las_trx/__main__.py
- name: Archive release artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-dist
path: dist
create-release:
needs: build-binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Detect prerelease
id: prerelease
run: |
if echo ${{ env.tag }} | grep -qe '?*.*.*rc*'; then
echo "prerelease=true" >> $GITHUB_ENV
else
echo "prerelease=false" >> $GITHUB_ENV
fi
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.tag }}
draft: true
prerelease: ${{ env.prerelease }}
artifacts: "artifacts/windows-latest-dist/*,artifacts/ubuntu-latest-dist/*"
artifactContentType: application/octet-stream
generateReleaseNotes: true