-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.12 KB
/
python-packaging.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
name: Python Application Packaging and Distribute
# env:
# UPX_VERSION: "4.2.4"
on:
push:
tags:
- "*"
workflow_dispatch:
permissions:
contents: write
jobs:
package:
name: Packaging and Release
runs-on: ubuntu-latest
env:
PY_VERSION: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PY_VERSION }}
# - name: Download and install UPX
# run: |
# curl -sSL https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz | tar -xJ --strip-components=1 -C /usr/local/bin upx-$UPX_VERSION-amd64_linux/upx
# upx --version
# Reference: https://github.com/marketplace/actions/upx-github-action
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: UPX version
run: upx --version
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install pyinstaller
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Package Application
run: |
echo "Packaging Our App ..."
pyinstaller \
--name email-manager \
--clean \
--log-level ERROR \
--upx-dir "dirname $(which upx)" \
--contents-directory "." \
--distpath dist \
--workpath build \
--specpath . \
--exclude-module pyinstaller \
--exclude-module pyinstaller-hooks-contrib \
--exclude-module packaging \
-y \
app.py
- name: List Package Contents
run: |
ls -la ./dist/email-manager/
- name: Create Artifacts for Release
run: |
tar -cvf dist/email-manager.tar dist/email-manager/
ls -la dist
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/email-manager.tar"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}