1515env :
1616 IS_GITHUB_ACTIONS : 1
1717 CHANNEL : " ${{ inputs.channel }}"
18- FLUTTER_VERSION : ' 3.24.0 '
19- NDK_VERSION : r26d
18+ FLUTTER_VERSION : ' 3.38.5 '
19+ NDK_VERSION : r28c
2020 UPLOAD_ARTIFACT : " ${{ inputs.upload-artifact }}"
2121 TAG_NAME : " ${{ inputs.tag-name }}"
22- TARGET_NAME_AppImage : " Hiddify-Linux-x64"
22+ TARGET_NAME_gz : " Hiddify-Linux-x64-AppImage.tar "
2323 TARGET_NAME_deb : " Hiddify-Debian-x64"
24- TARGET_NAME_rpm : " Hiddify-rpm-x64"
24+ # TARGET_NAME_rpm: "Hiddify-rpm-x64"
2525 TARGET_NAME_apk : " Hiddify-Android"
2626 TARGET_NAME_aab : " Hiddify-Android"
27- # TARGET_NAME_exe: "Hiddify-Windows-x64"
27+ TARGET_NAME_exe : " Hiddify-Windows-Setup-x64"
28+ TARGET_NAME_msix : " Hiddify-Windows-x64"
29+ TARGET_NAME_zip : " Hiddify-Windows-Portable-x64"
2830 TARGET_NAME_dmg : " Hiddify-MacOS"
2931 TARGET_NAME_pkg : " Hiddify-MacOS-Installer"
3032 TARGET_NAME_ipa : " Hiddify-iOS"
4446 cache : true
4547
4648 - name : Prepare
47- run : make linux-prepare
49+ run : make linux-amd64- prepare
4850 - name : Test
4951 run : flutter test
5052
@@ -69,17 +71,32 @@ jobs:
6971 targets : aab
7072
7173 - platform : windows
72- os : windows-2019
74+ os : windows-latest
7375 aarch : amd64
74- targets : exe,msix
76+ targets : exe,msix,zip
7577
76- - platform : linux
78+ - platform : linux-amd64
7779 os : ubuntu-22.04
7880 aarch : amd64
79- targets : AppImage,deb,rpm
80-
81+ targets : deb,gz
82+
83+ # - platform: linux-arm64
84+ # os: ubuntu-24.04-arm
85+ # aarch: arm64
86+ # targets: deb,gz
87+
88+ # - platform: linux-amd64-musl
89+ # os: ubuntu-22.04
90+ # aarch: amd64
91+ # targets: deb,gz
92+
93+ # - platform: linux-arm64-musl
94+ # os: ubuntu-24.04-arm
95+ # aarch: arm64
96+ # targets: deb,gz
97+
8198 - platform : macos
82- os : macos-13
99+ os : macos-15
83100 aarch : universal
84101 targets : dmg,pkg
85102
@@ -106,46 +123,90 @@ jobs:
106123 mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
107124 echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles
108125 ls ~/Library/MobileDevice/Provisioning\ Profiles
126+ security unlock-keychain -p "" signing_temp.keychain
127+ security find-identity -v -p codesigning
109128 # ls ~/Library/MobileDevice/Provisioning\ Profiles
110129 # echo "${{secrets.NEW_APPLE_MOBILE_PROVISIONING_PROFILES_TARXZ_BASE64}}"|base64 --decode | tar xJ -C ~/Library/MobileDevice/Provisioning\ Profiles
111130 # # echo "${{secrets.NEW_APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64_2}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles
112131
113132
114133
115-
134+ - name : Setup Flutter for arm64
135+ if : ${{ startsWith(matrix.platform,'linux-arm64') }}
136+ uses : hurelhuyag/flutter-arm64-action@HEAD
137+ with :
138+ channel : ' stable'
139+ flutter-version : ${{ env.FLUTTER_VERSION }}
140+
116141 - name : Setup Flutter
117- uses : subosito/flutter-action@v2.16.0 # issue with 2.13
142+ if : ${{ !startsWith(matrix.platform, 'linux-arm64') }}
143+ uses : subosito/flutter-action@v2.21.0 # issue with 2.13
118144 with :
119145 flutter-version : ${{ env.FLUTTER_VERSION }}
120146 # flutter-version-file: pubspec.yaml
121147 channel : ' stable'
122148 cache : true
123-
149+ - name : Clean up disk space
150+ if : startsWith(matrix.platform,'android')
151+ run : |
152+ df -h
153+ sudo rm -rf /usr/share/dotnet
154+ df -h
155+ sudo rm -rf /opt/ghc
156+ df -h
157+ sudo rm -rf /opt/hostedtoolcache/CodeQL
158+ df -h
159+ rm -rf ~/.gradle/caches
160+ df -h
161+ sudo apt-get autoremove -y
162+ df -h
163+ sudo apt-get clean
164+ df -h
165+ tree
124166
125167 - name : Setup Java
126168 if : startsWith(matrix.platform,'android')
127169 uses : actions/setup-java@v4
128170 with :
129171 distribution : ' zulu'
130172 java-version : 17
131- - name : Setup NDK
173+ # - name: Setup NDK
174+ # if: startsWith(matrix.platform,'android')
175+ # uses: nttld/setup-ndk@v1
176+ # id: setup-ndk
177+ # with:
178+ # ndk-version: ${{ env.NDK_VERSION }}
179+ # add-to-path: true
180+ # link-to-sdk: true
181+
182+ - name : Setup Android SDK
183+ uses : android-actions/setup-android@v3
132184 if : startsWith(matrix.platform,'android')
133- uses : nttld/setup-ndk@v1
134- id : setup-ndk
135- with :
136- ndk-version : ${{ env.NDK_VERSION }}
137- add-to-path : true
138- link-to-sdk : true
139-
140- - name : Setup Gradle 8.1
185+ # - name: Cache Android SDK
186+ # uses: actions/cache@v4
187+ # if: startsWith(matrix.platform,'android')
188+ # with:
189+ # path: |
190+ # /usr/local/lib/android/sdk
191+ # key: android-sdk-${{ runner.os }}-${{ env.NDK_VERSION }}
192+ # restore-keys: |
193+ # android-sdk-${{ runner.os }}-
194+ - name : Cache Gradle
195+ uses : actions/cache@v4
141196 if : startsWith(matrix.platform,'android')
142- uses : gradle/actions/setup-gradle@v3
197+
143198 with :
144- gradle-version : 7.5
199+ path : |
200+ ~/.gradle/caches
201+ ~/.gradle/wrapper
202+ key : gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
203+ restore-keys : |
204+ gradle-${{ runner.os }}-
205+
145206 - name : Setup dependencies
146207 run : |
147- make ${{ matrix.platform }}-install-dependencies
148-
208+ make ${{ matrix.platform }}-install-deps
209+ echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
149210
150211 - name : Setup Android Signing Properties
151212 if : ${{ inputs.upload-artifact && startsWith(matrix.platform,'android') }}
@@ -176,7 +237,8 @@ jobs:
176237 - name : Prepare for ${{ matrix.platform }}
177238 run : |
178239 make ${{ matrix.platform }}-prepare
179- tree
240+
241+
180242 - name : Build ${{ matrix.platform }}
181243 env :
182244 SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
@@ -197,10 +259,24 @@ jobs:
197259
198260 - name : Copy to out Windows
199261 if : matrix.platform == 'windows'
262+ shell : pwsh
200263 run : |
201- tree
202- .\scripts\package_windows.ps1
203-
264+ Get-ChildItem -Path dist -Recurse | Select-Object FullName
265+ New-Item -ItemType Directory -Path "out" -Force | Out-Null
266+ $targets = "${{ matrix.targets }}".Split(',')
267+ foreach ($ext in $targets) {
268+ $ext = $ext.Trim()
269+ $key = "TARGET_NAME_$ext"
270+ $targetName = (Get-Item "env:$key").Value
271+
272+ $files = Get-ChildItem -Path dist -Recurse -Filter "*.$ext"
273+
274+ foreach ($file in $files) {
275+ $destination = Join-Path -Path "out" -ChildPath "$targetName.$ext"
276+ Move-Item -Path $file.FullName -Destination $destination -Force
277+ }
278+ }
279+ Get-ChildItem -Path out
204280
205281 - name : Upload Debug Symbols
206282 if : ${{ inputs.upload-artifact && inputs.tag-name != 'draft' }}
@@ -246,7 +322,7 @@ jobs:
246322 echo "For $EXT ($KEY) filename is ${FILENAME}"
247323 mv dist/*/*.$EXT tmp_out/${FILENAME}.$EXT
248324 ls tmp_out
249- chmod +x tmp_out/${FILENAME}.$EXT
325+ [[ "$EXT" != "gz" ]] && chmod +x tmp_out/${FILENAME}.$EXT || echo "Skipping chmod for gz"
250326 if [ "${{matrix.platform}}" == "linux" ];then
251327 cp ./.github/help/linux/* tmp_out/
252328 else
@@ -310,11 +386,12 @@ jobs:
310386 deleteOnlyFromDrafts : false
311387
312388 - name : prepare_release_message
389+ continue-on-error : true
313390 run : |
314- pip install gitchangelog pystache mustache markdown
315- prelease=$(curl --silent "https://api.github.com/repos/hiddify/hiddify-next/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
316- current="${{ github.ref_name }}"
391+ set +e
317392 sed 's|RELEASE_TAG|${{ env.TAG_NAME }}|g' ./.github/release_message.md > release.md
393+ pip install gitchangelog pystache mustache markdown
394+ prelease=$(curl --silent "https://api.github.com/repos/hiddify/hiddify-app/releases/latest" | grep -Po '"tag_name": "\K([^"]*)')
318395 echo -e "\n\n<details markdown=1><summary>All changes from $current to the latest commit:</summary>\n\n">>release.md
319396 gitchangelog "${prelease}.." >> release.md 2>&1 || echo "Error in gitchangelog"
320397 echo -e "\n\n</details>">>release.md
@@ -328,6 +405,21 @@ jobs:
328405 tag_name : ' draft'
329406 body_path : ' ./release.md'
330407 prerelease : true
408+
409+ - name : Create or Update Draft Release
410+ uses : softprops/action-gh-release@v1
411+ env :
412+ GITHUB_TOKEN : ${{ secrets.TOKEN_FOR_HIDDIFY_APP_REPO }}
413+ GITHUB_REPOSITORY : hiddify/hiddify-app
414+ with :
415+ files : ./out/*
416+ name : ' draft'
417+ tag_name : ' draft'
418+ body_path : ' ./release.md'
419+ target_commitish : ' 530bf77839a74d4f13847ba244a20734ac7ab119'
420+ prerelease : true
421+ repository : hiddify/hiddify-app
422+
331423 upload-release :
332424 permissions : write-all
333425 if : ${{ inputs.upload-artifact && inputs.tag-name != 'draft' }}
0 commit comments