-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (140 loc) · 4.66 KB
/
Copy pathbuild-release.yml
File metadata and controls
157 lines (140 loc) · 4.66 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
name: Build and Release
on:
workflow_dispatch:
inputs:
version:
description: 'Версия релиза (например, 1.0.0)'
required: true
type: string
notes:
description: 'Описание релиза'
required: false
type: string
default: ''
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
- os: windows-latest
platform: windows
arch: amd64
- os: ubuntu-latest
platform: linux
arch: amd64
- os: macos-latest
platform: macos
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies (latest)
shell: bash
run: |
pip install -e . pyinstaller
- name: Create mirrors list
shell: bash
run: |
cat > mirrors.txt << 'EOF'
https://ghproxy.net/
https://ghfast.top/
https://gh-proxy.org/
EOF
- name: Create Linux launcher
if: matrix.platform == 'linux'
shell: bash
run: |
cat > START.sh << 'SCRIPT'
#!/bin/sh
cd "$(dirname "$0")"
for t in foot kitty alacritty wezterm gnome-terminal konsole xfce4-terminal lxterminal mate-terminal tilix terminator xterm urxvt st; do
if command -v "$t" >/dev/null 2>&1; then
exec "$t" -e ./Varekai
fi
done
echo "No terminal emulator found. Please install one (foot, kitty, alacritty, gnome-terminal, etc.)."
read -p "Press Enter to exit..."
SCRIPT
chmod +x START.sh
cat > START.desktop << 'EOF'
[Desktop Entry]
Name=Varekai Client
Comment=VPN client based on prizrak-core
Exec=./START.sh
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Network;VPN;
EOF
- name: Create macOS starter
if: matrix.platform == 'macos'
shell: bash
run: |
printf '#!/bin/bash\ncd "$(dirname "$0")"\n./Varekai\n' > START.command
chmod +x START.command
- name: Build with PyInstaller
shell: bash
run: |
pyinstaller --onedir --name varekai-client main.py
if [ "${{ matrix.platform }}" = "windows" ]; then
mv dist/varekai-client/varekai-client.exe dist/varekai-client/START.exe
else
mv dist/varekai-client/varekai-client dist/varekai-client/Varekai
fi
cp mirrors.txt dist/varekai-client/
if [ "${{ matrix.platform }}" = "linux" ]; then
cp START.sh START.desktop dist/varekai-client/
elif [ "${{ matrix.platform }}" = "macos" ]; then
cp START.command dist/varekai-client/
fi
- name: Package
shell: bash
run: |
cd dist
if [ "${{ matrix.platform }}" = "windows" ]; then
7z a ../varekai-client-${{ matrix.platform }}-${{ matrix.arch }}-v${{ inputs.version }}.zip varekai-client/
else
tar -czf ../varekai-client-${{ matrix.platform }}-${{ matrix.arch }}-v${{ inputs.version }}.tar.gz varekai-client/
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: varekai-client-${{ matrix.platform }}-${{ matrix.arch }}
path: varekai-client-${{ matrix.platform }}-${{ matrix.arch }}-v${{ inputs.version }}.*
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if version exists
run: |
if git ls-remote --tags origin | grep -q "refs/tags/v${{ inputs.version }}"; then
echo "::error::Версия v${{ inputs.version }} уже существует. Укажите новую версию."
exit 1
fi
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts (debug)
run: find artifacts -type f
- name: Create Release (draft)
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version }}
name: Varekai Client v${{ inputs.version }}
body: ${{ inputs.notes }}
draft: true
files: artifacts/*