-
Notifications
You must be signed in to change notification settings - Fork 82
230 lines (225 loc) · 11.1 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Release
on:
workflow_dispatch
jobs:
setup:
name: Setup
uses: tlslink/sslcon/.github/workflows/release-setup.yml@main
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, linux-latest, windows, macos, macos-arm64]
include:
- build: linux-latest
os: ubuntu-22.04
qt: 6.6.2
arch: gcc_64
qt-modules: 'qtwebsockets'
# qt-tools: 'tools_ifw'
installer-name: anylink-linux-amd64.run
- build: linux
os: ubuntu-20.04
qt: 6.4.3
arch: gcc_64
qt-modules: 'qtwebsockets'
# qt-tools: 'tools_ifw'
installer-name: anylink-linux-amd64.run
- build: windows
os: windows-2019
qt: 6.6.2
arch: win64_msvc2019_64
qt-modules: 'qtwebsockets'
qt-tools: 'tools_qtcreator'
installer-name: anylink-windows10-amd64.exe
- build: macos
os: macos-12
qt: 6.6.2
arch: clang_64
qt-modules: 'qtwebsockets'
# qt-tools: 'tools_ifw'
installer-name: anylink-installer
- build: macos-arm64
os: macos-14
qt: 6.6.2
arch: clang_64
qt-modules: 'qtwebsockets'
# qt-tools: 'tools_ifw'
installer-name: anylink-installer
steps:
- if: startsWith(github.ref, 'refs/heads/')
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux-latest" ]; then
echo "ARCHIVE_NAME=anylink-linux_openssl3-amd64.tar.gz" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "linux" ]; then
echo "ARCHIVE_NAME=anylink-linux-amd64.tar.gz" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "windows" ]; then
echo "ARCHIVE_NAME=anylink-windows10-amd64.zip" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "macos" ]; then
echo "ARCHIVE_NAME=anylink-macOS-amd64.dmg" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "macos-arm64" ]; then
echo "ARCHIVE_NAME=anylink-macOS-arm64.dmg" >> $GITHUB_ENV
fi
- if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux-latest" ]; then
echo "ARCHIVE_NAME=anylink-${{ github.ref_name }}-linux_openssl3-amd64.tar.gz" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "linux" ]; then
echo "ARCHIVE_NAME=anylink-${{ github.ref_name }}-linux-amd64.tar.gz" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "windows" ]; then
echo "ARCHIVE_NAME=anylink-${{ github.ref_name }}-windows10-amd64.zip" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "macos" ]; then
echo "ARCHIVE_NAME=anylink-${{ github.ref_name }}-macOS-amd64.dmg" >> $GITHUB_ENV
elif [ "${{ matrix.build }}" = "macos-arm64" ]; then
echo "ARCHIVE_NAME=anylink-${{ github.ref_name }}-macOS-arm64.dmg" >> $GITHUB_ENV
fi
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux" -o "${{ matrix.build }}" = "linux-latest" ]; then
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -q --force-yes \
automake cmake git wget libfuse2 desktop-file-utils tree \
build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev \
libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \
libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \
libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \
libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \
libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 \
libxkbcommon-x11-dev extra-cmake-modules fcitx-libs-dev
fi
# https://github.com/ilammy/msvc-dev-cmd
- if: matrix.build == 'windows'
name: Setup msvc
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
# v3,aqtversion 为 2.11,不支持将工具添加到 $PATH,https://github.com/jurplel/install-qt-action
uses: jurplel/install-qt-action@v3
with:
arch: ${{ matrix.arch }}
version: ${{ matrix.qt }} # https://download.qt.io/online/qtsdkrepository/
modules: ${{ matrix.qt-modules }}
tools: ${{ matrix.qt-tools }}
install-deps: false
cache: false
cache-key-prefix: 'cache-qt'
aqtversion: '==3.1.*'
extra: '--base https://mirrors.ocf.berkeley.edu/qt' # https://download.qt.io/static/mirrorlist/
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Build
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux" -o "${{ matrix.build }}" = "linux-latest" ]; then
qmake
make -j $(nproc)
wget -c -nv https://github.com/fcitx/fcitx-qt5/archive/refs/heads/master.zip
unzip master.zip
cd fcitx-qt5-master
cmake -DENABLE_QT5=Off -DENABLE_QT6=On .
make -j $(nproc)
cd ..
elif [ "${{ matrix.build }}" = "windows" ]; then
rm "C:\Program Files\Git\usr\bin\link.exe"
qmake
"${IQTA_TOOLS}/QtCreator/bin/jom/jom.exe" -j $(nproc) -f Makefile.Release
elif [ "${{ matrix.build }}" = "macos" ]; then
qmake
make -j $(sysctl -n hw.logicalcpu)
elif [ "${{ matrix.build }}" = "macos-arm64" ]; then
qmake
make -j $(sysctl -n hw.logicalcpu)
fi
- name: Build archive
shell: bash
run: |
echo $PATH
mkdir archive
# ls -lR
if [ "${{ matrix.build }}" = "linux" ]; then
# probonopd
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage out/opt/anylink/bin/anylink -extra-plugins=platformthemes/libqgtk3.so -no-copy-copyright-files -no-translations -unsupported-allow-new-glibc
cp fcitx-qt5-master/qt6/platforminputcontext/libfcitxplatforminputcontextplugin-qt6.so out/opt/anylink/plugins/platforminputcontexts/
wget -c -nv https://github.com/tlslink/sslcon/releases/download/continuous/sslcon-linux-amd64.tar.gz
tar -zxvf sslcon-*.tar.gz
cp vpnagent sslcon out/opt/anylink/bin
7z a installer/packages/root/data/anylink.7z ./out/opt/anylink/*
cd installer
wget -c -nv https://mirrors.ustc.edu.cn/qtproject/official_releases/qt-installer-framework/4.7.0/QtInstallerFramework-linux-x64-4.7.0.run
chmod +x ./*.run
./QtInstallerFramework-linux-x64-4.7.0.run --al --da -c -t `pwd`/ifw in
./ifw/bin/binarycreator --offline-only -c config/config.xml -p packages ${{ matrix.installer-name }}
chmod +x ./*.run
tar -zcvf "${{ github.workspace }}"/archive/${{ env.ARCHIVE_NAME }} ${{ matrix.installer-name }}
elif [ "${{ matrix.build }}" = "windows" ]; then
windeployqt out/bin/anylink.exe --no-translations --no-system-d3d-compiler --no-opengl-sw --no-svg
curl -k -L -O https://github.com/tlslink/sslcon/releases/download/continuous/sslcon-windows10-amd64.7z
7z x -y sslcon-*.7z
cp vpnagent.exe sslcon.exe out/bin
7z a installer/packages/root/data/anylink.7z ./out/bin/*
cd installer
curl -k -O -L https://mirrors.ustc.edu.cn/qtproject/archive/qt-installer-framework/4.5.2/QtInstallerFramework-windows-x64-4.5.2.exe
./QtInstallerFramework-windows-x64-4.5.2.exe --al --da -c -t `pwd`/ifw in
./ifw/bin/binarycreator --offline-only -c config/config.xml -p packages ${{ matrix.installer-name }}
# https://bugreports.qt.io/browse/QTIFW-2295
editbin /subsystem:windows ${{ matrix.installer-name }}
7z a -tzip -r "${{ github.workspace }}"/archive/${{ env.ARCHIVE_NAME }} ${{ matrix.installer-name }}
elif [ "${{ matrix.build }}" = "macos" ]; then
cd installer
curl -k -O -L https://mirrors.ustc.edu.cn/qtproject/archive/qt-installer-framework/4.6.1/QtInstallerFramework-macOS-x64-4.6.1.dmg
hdiutil attach ./QtInstallerFramework-macOS-x64-4.6.1.dmg
/Volumes/QtInstallerFramework-macOS-x64-4.6.1/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/MacOS/QtInstallerFramework-macOS-x64-4.6.1 --al --da -c -t `pwd`/ifw in
cd ../out/bin
curl -k -L -O https://github.com/tlslink/sslcon/releases/download/continuous/sslcon-macOS-amd64.tar.gz
tar -zxvf sslcon-*.tar.gz
cp vpnagent sslcon AnyLink.app/Contents/MacOS
macdeployqt AnyLink.app
mkdir -p ../../installer/packages/root/data
../../installer/ifw/bin/archivegen ../../installer/packages/root/data/anylink.7z ./AnyLink.app
cd ../../installer
./ifw/bin/binarycreator --offline-only -c config/config.xml -p packages ${{ matrix.installer-name }}
hdiutil create -fs HFS+ -srcfolder ${{ matrix.installer-name }}.app -format UDZO "${{ github.workspace }}"/archive/${{ env.ARCHIVE_NAME }}
elif [ "${{ matrix.build }}" = "macos-arm64" ]; then
cd installer
curl -k -O -L https://mirrors.ustc.edu.cn/qtproject/archive/qt-installer-framework/4.6.1/QtInstallerFramework-macOS-x64-4.6.1.dmg
hdiutil attach ./QtInstallerFramework-macOS-x64-4.6.1.dmg
/Volumes/QtInstallerFramework-macOS-x64-4.6.1/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/MacOS/QtInstallerFramework-macOS-x64-4.6.1 --al --da -c -t `pwd`/ifw in
cd ../out/bin
curl -k -L -O https://github.com/tlslink/sslcon/releases/download/continuous/sslcon-macOS-arm64.tar.gz
tar -zxvf sslcon-*.tar.gz
cp vpnagent sslcon AnyLink.app/Contents/MacOS
macdeployqt AnyLink.app
mkdir -p ../../installer/packages/root/data
../../installer/ifw/bin/archivegen ../../installer/packages/root/data/anylink.7z ./AnyLink.app
cd ../../installer
./ifw/bin/binarycreator --offline-only -c config/config.xml -p packages ${{ matrix.installer-name }}
hdiutil create -fs HFS+ -srcfolder ${{ matrix.installer-name }}.app -format UDZO "${{ github.workspace }}"/archive/${{ env.ARCHIVE_NAME }}
fi
- if: startsWith(github.ref, 'refs/heads/')
name: Continuous release
uses: softprops/action-gh-release@v1
with:
prerelease: false
files: archive/${{ env.ARCHIVE_NAME }}
tag_name: continuous
- if: startsWith(github.ref, 'refs/tags/') && (matrix.build == 'windows')
name: Tagged release
uses: softprops/action-gh-release@v1
with:
name: Release build (${{ github.ref_name }})
body: 'See [README](https://github.com/tlslink/anylink-client) for more details.'
files: archive/${{ env.ARCHIVE_NAME }}
generate_release_notes: true
- if: startsWith(github.ref, 'refs/tags/') && (matrix.build != 'windows')
name: Tagged release
uses: softprops/action-gh-release@v1
with:
name: Release build (${{ github.ref_name }})
files: archive/${{ env.ARCHIVE_NAME }}