-
Notifications
You must be signed in to change notification settings - Fork 10
60 lines (50 loc) · 1.48 KB
/
build_and_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
name: Build binaries and Upload to Release
on:
push:
branches: [main]
paths:
- "version"
workflow_dispatch: {}
jobs:
build:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.11"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.poetry/cache
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Dependencies
run: |
pip install poetry
poetry add pyinstaller
poetry config virtualenvs.create true
poetry install --no-root
- name: Build
run: |
if [ "${{ runner.os }}" == 'Windows' ]; then
poetry run pyinstaller -F main.py -n ToolDelta.exe -i logo.png
else
poetry run pyinstaller -F main.py -n ToolDelta -i logo.png
fi
- name: Get version
run: echo "VERSION=$(<version)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
files: dist/*