-
Notifications
You must be signed in to change notification settings - Fork 15
72 lines (61 loc) · 2.05 KB
/
release-build-pyinstaller.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
name: Build PyInstaller artifacts (Release)
on:
release:
types:
- published
jobs:
pyinstaller:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: macOS
os: macos-11
dist_name: betty-macos
python: '3.12'
- name: Windows
os: windows-2019
dist_name: betty-windows
python: '3.12'
steps:
- name: Check out the source code
uses: actions/checkout@v4
- name: Get the pip cache directory
run: echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_ENV
shell: bash
- name: Cache pip
uses: actions/cache@v4
with:
path: ${{ env.pip_cache_dir }}
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('./setup.py') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python }}-
- name: Get the npm cache directory
run: echo "npm_cache_dir=$(npm config get cache)" >> $GITHUB_ENV
shell: bash
- name: Cache npm
uses: actions/cache@v4
with:
path: ${{ env.npm_cache_dir }}
key: npm-${{ runner.os }}-${{ hashFiles('./package.json') }}
restore-keys: |
npm-${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build the executable
run: ./bin/build-pyinstaller ${{ github.event.release.tag_name }}
shell: bash
- name: Zip the macOS package
if: startsWith(runner.os, 'macOS')
run: zip -r -X ./dist/${{ matrix.dist_name }}.zip ./dist/betty
shell: bash
- name: Zip the Windows package
if: startsWith(runner.os, 'Windows')
run: Compress-Archive .\dist\betty .\dist\${{ matrix.dist_name }}.zip
- name: Publish the package
run: gh release upload ${{ github.event.release.tag_name }} ./dist/${{ matrix.dist_name }}.zip --clobber
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}