Skip to content

Commit 5975f20

Browse files
committed
Optimize android vpn performance
Update ndk version Optimize more details Add linux on arm build Add win on arm build
1 parent a77b3a3 commit 5975f20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1464
-714
lines changed

.github/workflows/build.yaml

Lines changed: 180 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,25 @@ jobs:
1313
strategy:
1414
matrix:
1515
include:
16-
- platform: android
17-
os: ubuntu-latest
16+
# - platform: android
17+
# os: ubuntu-latest
18+
# - platform: windows
19+
# os: windows-latest
20+
# arch: amd64
21+
# - platform: linux
22+
# os: ubuntu-latest
23+
# arch: amd64
24+
# - platform: macos
25+
# os: macos-13
26+
# arch: amd64
27+
# - platform: macos
28+
# os: macos-latest
29+
# arch: arm64
1830
- platform: windows
19-
os: windows-latest
20-
arch: amd64
31+
os: windows-11-arm
32+
arch: arm64
2133
- platform: linux
22-
os: ubuntu-latest
23-
arch: amd64
24-
- platform: macos
25-
os: macos-13
26-
arch: amd64
27-
- platform: macos
28-
os: macos-latest
34+
os: ubuntu-24.04-arm
2935
arch: arm64
3036

3137
steps:
@@ -34,22 +40,6 @@ jobs:
3440
with:
3541
submodules: recursive
3642

37-
- name: Setup JAVA
38-
if: startsWith(matrix.platform,'android')
39-
uses: actions/setup-java@v4
40-
with:
41-
distribution: 'zulu'
42-
java-version: 17
43-
44-
- name: Setup NDK
45-
if: startsWith(matrix.platform,'android')
46-
uses: nttld/setup-ndk@v1
47-
id: setup-ndk
48-
with:
49-
ndk-version: r26b
50-
add-to-path: true
51-
link-to-sdk: true
52-
5343
- name: Setup Android Signing
5444
if: startsWith(matrix.platform,'android')
5545
run: |
@@ -62,14 +52,18 @@ jobs:
6252
- name: Setup Go
6353
uses: actions/setup-go@v5
6454
with:
65-
go-version: 'stable'
55+
go-version: '1.24.0'
6656
cache-dependency-path: |
6757
core/go.sum
6858
59+
- name: Setup rust
60+
if: startsWith(matrix.os, 'windows-11-arm')
61+
uses: dtolnay/rust-toolchain@stable
62+
6963
- name: Setup Flutter
7064
uses: subosito/flutter-action@v2
7165
with:
72-
channel: stable
66+
channel: ${{ (startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) && 'master' || 'stable' }}
7367
cache: true
7468

7569
- name: Get Flutter Dependency
@@ -85,161 +79,161 @@ jobs:
8579
path: ./dist
8680
overwrite: true
8781

88-
changelog:
89-
runs-on: ubuntu-latest
90-
needs: [ build ]
91-
steps:
92-
- name: Checkout
93-
uses: actions/checkout@v4
94-
if: ${{ env.IS_STABLE == 'true' }}
95-
with:
96-
fetch-depth: 0
97-
ref: refs/heads/main
98-
- name: Generate
99-
if: ${{ env.IS_STABLE == 'true' }}
100-
run: |
101-
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
102-
preTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1)
103-
currentTag=""
104-
for ((i = 0; i <= ${#tags[@]}; i++)); do
105-
if (( i < ${#tags[@]} )); then
106-
tag=${tags[$i]}
107-
else
108-
tag=""
109-
fi
110-
if [ -n "$currentTag" ]; then
111-
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
112-
break
113-
fi
114-
fi
115-
if [ -n "$currentTag" ]; then
116-
echo "## $currentTag" >> NEW_CHANGELOG.md
117-
echo "" >> NEW_CHANGELOG.md
118-
if [ -n "$tag" ]; then
119-
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
120-
else
121-
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
122-
fi
123-
echo "" >> NEW_CHANGELOG.md
124-
fi
125-
currentTag=$tag
126-
done
127-
cat CHANGELOG.md >> NEW_CHANGELOG.md
128-
cat NEW_CHANGELOG.md > CHANGELOG.md
129-
130-
- name: Commit
131-
if: ${{ env.IS_STABLE == 'true' }}
132-
run: |
133-
git add CHANGELOG.md
134-
if ! git diff --cached --quiet; then
135-
echo "Commit pushing"
136-
git config --local user.email "[email protected]"
137-
git config --local user.name "chen08209"
138-
git commit -m "Update changelog"
139-
git push
140-
if [ $? -eq 0 ]; then
141-
echo "Push succeeded"
142-
else
143-
echo "Push failed"
144-
exit 1
145-
fi
146-
fi
147-
148-
env:
149-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150-
151-
upload:
152-
permissions: write-all
153-
needs: [ build ]
154-
runs-on: ubuntu-latest
155-
services:
156-
telegram-bot-api:
157-
image: aiogram/telegram-bot-api:latest
158-
env:
159-
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
160-
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
161-
ports:
162-
- 8081:8081
163-
steps:
164-
- name: Checkout
165-
uses: actions/checkout@v4
166-
with:
167-
fetch-depth: 0
168-
169-
- name: Download
170-
uses: actions/download-artifact@v4
171-
with:
172-
path: ./dist/
173-
pattern: artifact-*
174-
merge-multiple: true
175-
176-
- name: Generate release.md
177-
run: |
178-
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
179-
preTag=$(curl --silent "https://api.github.com/repos/chen08209/FlClash/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' || echo "")
180-
currentTag=""
181-
for ((i = 0; i <= ${#tags[@]}; i++)); do
182-
if (( i < ${#tags[@]} )); then
183-
tag=${tags[$i]}
184-
else
185-
tag=""
186-
fi
187-
if [ -n "$currentTag" ]; then
188-
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
189-
break
190-
fi
191-
fi
192-
if [ -n "$currentTag" ]; then
193-
if [ -n "$tag" ]; then
194-
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
195-
else
196-
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
197-
fi
198-
echo "" >> release.md
199-
fi
200-
currentTag=$tag
201-
done
202-
203-
- name: Push to telegram
204-
env:
205-
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
206-
TAG: ${{ github.ref_name }}
207-
run: |
208-
python -m pip install --upgrade pip
209-
pip install requests
210-
python release_telegram.py
211-
212-
- name: Patch release.md
213-
run: |
214-
version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
215-
sed "s|VERSION|$version|g" ./.github/release_template.md >> release.md
216-
217-
- name: Release
218-
if: ${{ env.IS_STABLE == 'true' }}
219-
uses: softprops/action-gh-release@v2
220-
with:
221-
files: ./dist/*
222-
body_path: './release.md'
223-
224-
- name: Create Fdroid Source Dir
225-
if: ${{ env.IS_STABLE == 'true' }}
226-
run: |
227-
mkdir -p ./tmp
228-
cp ./dist/*android-arm64-v8a* ./tmp/ || true
229-
echo "Files copied successfully"
230-
231-
- name: Push to fdroid repo
232-
if: ${{ env.IS_STABLE == 'true' }}
233-
uses: cpina/[email protected]
234-
env:
235-
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
236-
with:
237-
source-directory: ./tmp/
238-
destination-github-username: chen08209
239-
destination-repository-name: FlClash-fdroid-repo
240-
user-name: 'github-actions[bot]'
241-
user-email: 'github-actions[bot]@users.noreply.github.com'
242-
target-branch: main
243-
commit-message: Update from ${{ github.ref_name }}
244-
target-directory: /tmp/
82+
# changelog:
83+
# runs-on: ubuntu-latest
84+
# needs: [ build ]
85+
# steps:
86+
# - name: Checkout
87+
# uses: actions/checkout@v4
88+
# if: ${{ env.IS_STABLE == 'true' }}
89+
# with:
90+
# fetch-depth: 0
91+
# ref: refs/heads/main
92+
# - name: Generate
93+
# if: ${{ env.IS_STABLE == 'true' }}
94+
# run: |
95+
# tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
96+
# preTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1)
97+
# currentTag=""
98+
# for ((i = 0; i <= ${#tags[@]}; i++)); do
99+
# if (( i < ${#tags[@]} )); then
100+
# tag=${tags[$i]}
101+
# else
102+
# tag=""
103+
# fi
104+
# if [ -n "$currentTag" ]; then
105+
# if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
106+
# break
107+
# fi
108+
# fi
109+
# if [ -n "$currentTag" ]; then
110+
# echo "## $currentTag" >> NEW_CHANGELOG.md
111+
# echo "" >> NEW_CHANGELOG.md
112+
# if [ -n "$tag" ]; then
113+
# git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
114+
# else
115+
# git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
116+
# fi
117+
# echo "" >> NEW_CHANGELOG.md
118+
# fi
119+
# currentTag=$tag
120+
# done
121+
# cat CHANGELOG.md >> NEW_CHANGELOG.md
122+
# cat NEW_CHANGELOG.md > CHANGELOG.md
123+
#
124+
# - name: Commit
125+
# if: ${{ env.IS_STABLE == 'true' }}
126+
# run: |
127+
# git add CHANGELOG.md
128+
# if ! git diff --cached --quiet; then
129+
# echo "Commit pushing"
130+
# git config --local user.email "[email protected]"
131+
# git config --local user.name "chen08209"
132+
# git commit -m "Update changelog"
133+
# git push
134+
# if [ $? -eq 0 ]; then
135+
# echo "Push succeeded"
136+
# else
137+
# echo "Push failed"
138+
# exit 1
139+
# fi
140+
# fi
141+
#
142+
# env:
143+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
#
145+
# upload:
146+
# permissions: write-all
147+
# needs: [ build ]
148+
# runs-on: ubuntu-latest
149+
# services:
150+
# telegram-bot-api:
151+
# image: aiogram/telegram-bot-api:latest
152+
# env:
153+
# TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
154+
# TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
155+
# ports:
156+
# - 8081:8081
157+
# steps:
158+
# - name: Checkout
159+
# uses: actions/checkout@v4
160+
# with:
161+
# fetch-depth: 0
162+
#
163+
# - name: Download
164+
# uses: actions/download-artifact@v4
165+
# with:
166+
# path: ./dist/
167+
# pattern: artifact-*
168+
# merge-multiple: true
169+
#
170+
# - name: Generate release.md
171+
# run: |
172+
# tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
173+
# preTag=$(curl --silent "https://api.github.com/repos/chen08209/FlClash/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' || echo "")
174+
# currentTag=""
175+
# for ((i = 0; i <= ${#tags[@]}; i++)); do
176+
# if (( i < ${#tags[@]} )); then
177+
# tag=${tags[$i]}
178+
# else
179+
# tag=""
180+
# fi
181+
# if [ -n "$currentTag" ]; then
182+
# if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
183+
# break
184+
# fi
185+
# fi
186+
# if [ -n "$currentTag" ]; then
187+
# if [ -n "$tag" ]; then
188+
# git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
189+
# else
190+
# git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
191+
# fi
192+
# echo "" >> release.md
193+
# fi
194+
# currentTag=$tag
195+
# done
196+
#
197+
# - name: Push to telegram
198+
# env:
199+
# TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
200+
# TAG: ${{ github.ref_name }}
201+
# run: |
202+
# python -m pip install --upgrade pip
203+
# pip install requests
204+
# python release_telegram.py
205+
#
206+
# - name: Patch release.md
207+
# run: |
208+
# version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
209+
# sed "s|VERSION|$version|g" ./.github/release_template.md >> release.md
210+
#
211+
# - name: Release
212+
# if: ${{ env.IS_STABLE == 'true' }}
213+
# uses: softprops/action-gh-release@v2
214+
# with:
215+
# files: ./dist/*
216+
# body_path: './release.md'
217+
#
218+
# - name: Create Fdroid Source Dir
219+
# if: ${{ env.IS_STABLE == 'true' }}
220+
# run: |
221+
# mkdir -p ./tmp
222+
# cp ./dist/*android-arm64-v8a* ./tmp/ || true
223+
# echo "Files copied successfully"
224+
#
225+
# - name: Push to fdroid repo
226+
# if: ${{ env.IS_STABLE == 'true' }}
227+
# uses: cpina/[email protected]
228+
# env:
229+
# SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
230+
# with:
231+
# source-directory: ./tmp/
232+
# destination-github-username: chen08209
233+
# destination-repository-name: FlClash-fdroid-repo
234+
# user-name: 'github-actions[bot]'
235+
# user-email: 'github-actions[bot]@users.noreply.github.com'
236+
# target-branch: main
237+
# commit-message: Update from ${{ github.ref_name }}
238+
# target-directory: /tmp/
245239

0 commit comments

Comments
 (0)