-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·163 lines (133 loc) · 4.88 KB
/
release-build-python.yml
File metadata and controls
executable file
·163 lines (133 loc) · 4.88 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Release
on: workflow_dispatch
permissions:
contents: write
actions: write
jobs:
build-linux:
runs-on: ubuntu-latest
env:
NEXT_VERSION: ${{ secrets.NEXT_VERSION }}
PIP_LICENSES_LICENSE: ${{ secrets.PIP_LICENSES_LICENSE }}
PYTHON_LICENSE: ${{ secrets.PYTHON_LICENSE }}
PIP_LICENSE: ${{ secrets.PIP_LICENSE }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install pyinstaller
run: pip install pyinstaller
- name: Build project
run: pyinstaller --onefile src/main.py --name llm-cli
- name: Install pip-licenses
run: pip install pip-licenses
- name: Copy licenses
run: |
mkdir -p dist/licenses
cp LICENSE dist/licenses/llm-cli_license.txt
pip-licenses --format=plain-vertical --with-license-file --output-file=dist/licenses/dependencies_licenses.txt
echo '${{ env.PIP_LICENSES_LICENSE }}' > dist/licenses/pip-licenses_license.txt
echo '${{ env.PIP_LICENSE }}' > dist/licenses/pip_license.txt
- name: Compress build
if: success()
run: |
cd dist
zip -r llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu
path: dist/llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip
build-windows:
runs-on: windows-latest
env:
NEXT_VERSION: ${{ secrets.NEXT_VERSION }}
PIP_LICENSES_LICENSE: ${{ secrets.PIP_LICENSES_LICENSE }}
PYTHON_LICENSE: ${{ secrets.PYTHON_LICENSE }}
PIP_LICENSE: ${{ secrets.PIP_LICENSE }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install pyinstaller
run: pip install pyinstaller
- name: Build project
run: pyinstaller --onefile src/main.py --name llm-cli
- name: Install pip-licenses
run: pip install pip-licenses
- name: Copy licenses 1
run: |
mkdir -p dist/licenses
cp LICENSE dist/licenses/llm-cli_license.txt
pip-licenses --format=plain-vertical --with-license-file --output-file=dist/licenses/dependencies_licenses.txt
echo "${{ env.PIP_LICENSES_LICENSE }}" > dist/licenses/pip-licenses_license.txt
echo "${{ env.PIP_LICENSE }}" > dist/licenses/pip_license.txt
- name: Compress build
if: success()
run: |
cd dist
tar -cvf llm-cli-v${{ env.NEXT_VERSION }}_windows.zip *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: llm-cli-v${{ env.NEXT_VERSION }}_windows
path: dist/llm-cli-v${{ env.NEXT_VERSION }}_windows.zip
release_github:
runs-on: ubuntu-latest
needs:
- build-linux
- build-windows
env:
NEXT_TAG: ${{ secrets.NEXT_VERSION }}
NEXT_VERSION: ${{ secrets.NEXT_VERSION }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu
path: .
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: llm-cli-v${{ env.NEXT_VERSION }}_windows
path: .
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BODY: ${{ secrets.NEXT_RELEASE_DESCRIPTION }}
with:
tag_name: ${{ env.NEXT_TAG }}
release_name: llm-cli-v${{ env.NEXT_VERSION }}
body: ${{ env.BODY }}
draft: false
prerelease: false
- name: Upload Release Asset (windows-latest)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: llm-cli-v${{ env.NEXT_VERSION }}_windows.zip
asset_path: llm-cli-v${{ env.NEXT_VERSION }}_windows.zip
asset_content_type: application/zip
- name: Upload Release Asset (ubuntu-latest)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip
asset_path: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip
asset_content_type: application/zip