-
-
Notifications
You must be signed in to change notification settings - Fork 99
76 lines (64 loc) · 2.75 KB
/
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
73
74
75
76
name: Add PyInstaller assets to latest release
on:
push:
permissions:
contents: write
jobs:
get_tag:
# get the latest tag (separate job as Windows doesn't support this method)
# straightforward because in this repository tags are used only for releases, but we could do a regex match if not
runs-on: ubuntu-latest
outputs:
output: ${{ steps.latest_tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
- id: latest_tag
run: |
git fetch -a
echo "tag=$(git tag --sort -committerdate | head -n 1)" >> $GITHUB_OUTPUT
build:
needs: get_tag
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
# install requirements and build
# - note: `--hidden-import` is required for GUI mode until https://github.com/hustcc/timeago/issues/40 is fixed
- run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -r requirements-core.txt -r requirements-gui.txt pyinstaller
python -m PyInstaller --clean --noconsole --onefile --hidden-import timeago.locales.en_short --icon icon.png emailproxy.py
# add license, documentation, configuration file sample and disclaimer
# - note: `move [...] alias move=mv [...]` is to support using the same commands on all platforms
- run: |
move LICENSE . 2> nul || { shopt -s expand_aliases; alias move=mv; }
move LICENSE dist/
move README.md dist/
move emailproxy.config dist/
echo 'This binary distribution is automatically created for each Email OAuth 2.0 Proxy release, ' >> _.txt
echo 'but is not tested, and is not officially supported. Using the main emailproxy.py script ' >> _.txt
echo 'directly is recommended for best results: https://github.com/simonrob/email-oauth2-proxy/' >> _.txt
move _.txt dist/GettingStarted.txt
# on macOS `--onefile` creates bundle *and* binary; we don't need both (and the .app also contains the binary)
- if: runner.os == 'macOS'
run: rm dist/emailproxy
# zip the built output, naming according to tag and OS
- uses: thedoctor0/[email protected]
with:
type: zip
directory: dist/
filename: emailproxy-${{ needs.get_tag.outputs.output }}_pyinstaller-${{ runner.os }}.zip
# append the zip to the latest release
- uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: dist/*.zip
update_latest_release: true