-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
116 lines (102 loc) · 4.01 KB
/
action.yml
File metadata and controls
116 lines (102 loc) · 4.01 KB
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
name: 'Build Python Application Standalone Package'
description: 'An GitHub Actions used to automatically deploy your Python project with PyStand!'
author: 'BHznJNs'
inputs:
application-name:
description: "The application name of standalone package."
required: true
application-type:
description: "The application type, must be one of 'CLI' and 'GUI'."
required: false
default: "GUI"
python-version:
description: "The target Python embedded version to use."
required: true
default: "3.13.9"
pystand-entry-file:
description: "The entry file path for PyStand."
required: false
default: "PyStand.py"
requirements-path:
description: "The path to the requirements.txt file."
required: true
included-files:
description: |
Directories and files to be included in the build directory.
For directories, they will be copied to <build-directory>/<directory-name>;
for files, they will be copied to <build-directory>/
required: true
working-directory:
description: 'The working directory to run the action in.'
required: false
default: '.'
outputs:
build-directory:
description: "The built directory, can be used to create archive or installer."
value: ${{ steps.init-build-directory.outputs.build-directory }}
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Initialize build directory
id: init-build-directory
shell: bash
run: |
build_path="${RUNNER_TEMP}/pystand-build"
mkdir -p "$build_path"
echo "build-directory=$build_path" >> "$GITHUB_OUTPUT"
- name: Install Dependencies for PyStand Package
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
python -m venv venv
source venv/Scripts/activate
pip install -r "${{ inputs.requirements-path }}"
# move dependencies the build directory
build_path="${{ steps.init-build-directory.outputs.build-directory }}"
# Windows-only path; keep as-is until cross-platform support is needed
cp -r ./venv/Lib/site-packages "$build_path/site-packages"
rm -rf ./venv
- name: Download and Extract Python Embedded
id: setup-python-embedded
uses: BHznJNs/setup-python-embedded@release-2
with:
python-version: ${{ inputs.python-version }}
arch: "amd64"
- name: Move and rename Python Embedded files
shell: bash
run: |
build_path="${{ steps.init-build-directory.outputs.build-directory }}"
python_embedded_path="${{ steps.setup-python-embedded.outputs.python-embedded-path }}"
mv "$python_embedded_path" "$build_path/runtime"
- name: Download PyStand release
uses: robinraju/release-downloader@v1
with:
repository: skywind3000/PyStand
tag: 1.1.5
fileName: PyStand-v1.1.5-exe.zip
out-file-path: ${{ runner.temp }}
- name: Extract and Rename PyStand
shell: bash
run: |
set -e
cd "$RUNNER_TEMP"
mkdir -p pystand
unzip -q PyStand-v1.1.5-exe.zip -d pystand
build_path="${{ steps.init-build-directory.outputs.build-directory }}"
cp "pystand/PyStand-x64-${{ inputs.application-type }}/PyStand.exe" "$build_path/${{ inputs.application-name }}.exe"
rm -f PyStand-v1.1.5-exe.zip
rm -rf pystand
- name: Copy Sources and Assets to Build directory
id: copy-sources
shell: bash
working-directory: ${{ inputs.working-directory }}
run: python "$GITHUB_ACTION_PATH/scripts/copy_files.py"
env:
BUILD_PATH: ${{ steps.init-build-directory.outputs.build-directory }}
INCLUDED_FILES: ${{ inputs.included-files }}
PYSTAND_ENTRY_FILE: ${{ inputs.pystand-entry-file }}
APPLICATION_NAME: ${{ inputs.application-name }}