-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (172 loc) · 6.12 KB
/
release.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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Release new version of Application
on:
push:
branches: [ "master" ]
env:
ENV_FILE_PATH: ./Syncogram/sourcefiles/telegram/environments.py
JSON_CONFIG_PATH: Syncogram/config.json
jobs:
build_windows:
name: Build Windows App
runs-on: windows-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo "API_ID=${{ secrets.API_ID }}" > ${{ env.ENV_FILE_PATH }};
echo "API_HASH='${{ secrets.API_HASH }}'" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram
flet pack application.py `
--name "Syncogram" `
--icon "assets/logo/ico/duck128x128.ico" `
--product-name "Syncogram Application" `
--product-version "${{ env.json_APP_VERSION }}" `
--company-name "Syncogram Application" `
--copyright "GPL-3.0" `
--file-version "${{ env.json_APP_VERSION }}" `
--add-binary "locales;locales" `
--add-data "assets;assets" `
--add-data "config.json;." `
--distpath ../craft
cd ../
- name: Archive Windows Application
run: |
7z a Syncogram_Windows.zip $PWD\craft\Syncogram.exe
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "Windows"
path: Syncogram_Windows.zip
build_linux:
name: Build Linux App
runs-on: ubuntu-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo -ne "API_ID=${{ secrets.API_ID }}\n" > ${{ env.ENV_FILE_PATH }};
echo -ne "API_HASH='${{ secrets.API_HASH }}'\n" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram;
flet pack application.py \
--name "Syncogram" \
--icon "assets/logo/icns/duck512x512.icns" \
--product-name "Syncogram Application" \
--product-version "${{ env.json_APP_VERSION }}" \
--company-name "Syncogram Application" \
--copyright "GPL-3.0" \
--file-version "${{ env.json_APP_VERSION }}" \
--add-binary locales:locales \
--add-data assets:assets \
--add-data config.json:. \
--distpath ../craft;
cd ../;
- name: Archive Linux Application
run: |
tar -czvf Syncogram_Linux.tar.gz -C craft Syncogram
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "Linux"
path: Syncogram_Linux.tar.gz
build_macos:
name: Build MacOS App
runs-on: macos-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo -ne "API_ID=${{ secrets.API_ID }}\n" > ${{ env.ENV_FILE_PATH }};
echo -ne "API_HASH='${{ secrets.API_HASH }}'\n" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram;
flet pack application.py \
--name "Syncogram" \
--icon "assets/logo/icns/duck512x512.icns" \
--product-name "Syncogram Application" \
--product-version "${{ env.json_APP_VERSION }}" \
--company-name "Syncogram Application" \
--copyright "GPL-3.0" \
--file-version "${{ env.json_APP_VERSION }}" \
--add-binary locales:locales \
--add-data assets:assets \
--add-data config.json:. \
--distpath ../craft;
cd ../;
- name: Archive MacOS Application
run: |
tar -czvf Syncogram_MacOS.tar.gz -C craft Syncogram.app
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "MacOS"
path: Syncogram_MacOS.tar.gz
release_project:
name: Release Application
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
steps:
- name: Clone GitHub Repo
uses: actions/checkout@v3
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Creates Artifacts dir
run: mkdir artifacts
- name: Downloads Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R && pwd
working-directory: artifacts
- name: Create GitHub release
id: create-new-release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: "${{ env.json_APP_VERSION }}"
name: "v${{ env.json_APP_VERSION }}"
body: "Release Syncogram, ${{ env.json_APP_VERSION }}"
artifacts: "artifacts/MacOS/Syncogram_MacOS.tar.gz, artifacts/Linux/Syncogram_Linux.tar.gz, artifacts/Windows/Syncogram_Windows.zip"