1- name : Flutter Release
1+ name : Flutter Build
22
33on :
44 workflow_dispatch :
@@ -12,10 +12,11 @@ permissions:
1212env :
1313 APP_NAME : ServerBox
1414 RELEASE_TAG : ${{ github.ref_name }}
15+ BUILD_TAG : test-build-${{ github.run_number }}-${{ github.sha }}
1516
1617jobs :
17- releaseAndroid :
18- name : Release android
18+ buildAndroid :
19+ name : Build android
1920 runs-on : ubuntu-latest
2021 steps :
2122 - name : Checkout
@@ -33,17 +34,16 @@ jobs:
3334 java-version : " 21"
3435 - name : Fetch secrets
3536 run : |
36- curl -u ${{ secrets.BASIC_AUTH }} -o android/app/app.key ${{ secrets.URL_PREFIX }}app.key
37- curl -u ${{ secrets.BASIC_AUTH }} -o android/key.properties ${{ secrets.URL_PREFIX }}key.properties
37+ curl --fail --show-error --location - u ${{ secrets.BASIC_AUTH }} -o android/app/app.key ${{ secrets.URL_PREFIX }}app.key
38+ curl --fail --show-error --location - u ${{ secrets.BASIC_AUTH }} -o android/key.properties ${{ secrets.URL_PREFIX }}key.properties
3839 - name : Patch JNI build-id
3940 run : |
4041 flutter pub get
4142 scripts/release/patch-jni-build-id.sh
4243 - name : Build
4344 run : dart run fl_build -p android
44- - name : Verify F-Droid native libraries
45- run : scripts/release/verify-fdroid-native-libs.sh
46- - name : Rename for fdroid
45+ - name : Rename for release
46+ if : github.ref_type == 'tag'
4747 shell : bash
4848 run : |
4949 APK_DIR="build/app/outputs/flutter-apk"
5959 fi
6060 mv "${matches[0]}" "$APK_DIR/${APP_NAME}_${RELEASE_TAG}_${arch}.apk"
6161 done
62+ - name : Upload artifacts
63+ if : github.ref_type != 'tag'
64+ uses : actions/upload-artifact@v4
65+ with :
66+ name : ${{ env.APP_NAME }}-${{ env.BUILD_TAG }}-android
67+ path : build/app/outputs/flutter-apk/*.apk
68+ if-no-files-found : error
69+ retention-days : 14
6270 - name : Create Release
71+ if : github.ref_type == 'tag'
6372 uses : softprops/action-gh-release@v2
6473 with :
6574 files : |
@@ -69,16 +78,18 @@ jobs:
6978 env :
7079 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7180
72- releaseLinux :
73- name : Release linux
81+ buildLinux :
82+ name : Build linux
7483 strategy :
7584 fail-fast : false
7685 matrix :
7786 include :
7887 - runs_on : ubuntu-latest
88+ release_suffix : " "
7989 artifact_suffix : " "
8090 - runs_on : ubuntu-22.04
81- artifact_suffix : " _legacy"
91+ release_suffix : " _legacy"
92+ artifact_suffix : " -legacy"
8293 runs-on : ${{ matrix.runs_on }}
8394 steps :
8495 - name : Checkout
@@ -90,14 +101,12 @@ jobs:
90101 - name : Install dependencies
91102 run : |
92103 sudo apt update
93- # Basic
94104 sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev mesa-utils libvulkan-dev desktop-file-utils wget
95- # App Specific
96105 sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev libsecret-1-dev
97106 - name : Build
98- run : |
99- dart run fl_build -p linux
107+ run : dart run fl_build -p linux
100108 - name : Rename for release
109+ if : github.ref_type == 'tag'
101110 shell : bash
102111 run : |
103112 shopt -s nullglob
@@ -107,17 +116,26 @@ jobs:
107116 ls -la || true
108117 exit 1
109118 fi
110- mv "${matches[0]}" "${APP_NAME}_${RELEASE_TAG}${{ matrix.artifact_suffix }}_amd64.AppImage"
119+ mv "${matches[0]}" "${APP_NAME}_${RELEASE_TAG}${{ matrix.release_suffix }}_amd64.AppImage"
120+ - name : Upload artifacts
121+ if : github.ref_type != 'tag'
122+ uses : actions/upload-artifact@v4
123+ with :
124+ name : ${{ env.APP_NAME }}-${{ env.BUILD_TAG }}-linux${{ matrix.artifact_suffix }}
125+ path : " *.AppImage"
126+ if-no-files-found : error
127+ retention-days : 14
111128 - name : Create Release
129+ if : github.ref_type == 'tag'
112130 uses : softprops/action-gh-release@v2
113131 with :
114132 files : |
115- ${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}${{ matrix.artifact_suffix }}_amd64.AppImage
133+ ${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}${{ matrix.release_suffix }}_amd64.AppImage
116134 env :
117135 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118136
119- releaseWin :
120- name : Release windows
137+ buildWindows :
138+ name : Build windows
121139 runs-on : windows-latest
122140 steps :
123141 - name : Checkout
@@ -129,6 +147,7 @@ jobs:
129147 - name : Build
130148 run : dart run fl_build -p windows
131149 - name : Rename for release
150+ if : github.ref_type == 'tag'
132151 shell : bash
133152 run : |
134153 shopt -s nullglob
@@ -139,79 +158,19 @@ jobs:
139158 exit 1
140159 fi
141160 mv "${matches[0]}" "${APP_NAME}_${RELEASE_TAG}_windows_amd64.zip"
161+ - name : Upload artifacts
162+ if : github.ref_type != 'tag'
163+ uses : actions/upload-artifact@v4
164+ with :
165+ name : ${{ env.APP_NAME }}-${{ env.BUILD_TAG }}-windows
166+ path : " *_windows_amd64.zip"
167+ if-no-files-found : error
168+ retention-days : 14
142169 - name : Create Release
170+ if : github.ref_type == 'tag'
143171 uses : softprops/action-gh-release@v2
144172 with :
145173 files : |
146174 ${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_windows_amd64.zip
147175 env :
148176 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
149-
150- # releaseIOS:
151- # name: Release iOS
152- # runs-on: macos-latest
153- # steps:
154- # - name: Checkout
155- # uses: actions/checkout@v6
156- # with:
157- # submodules: recursive
158- # - name: Install Flutter
159- # uses: subosito/flutter-action@v2
160- # - name: Build
161- # run: |
162- # dart run fl_build -p ios -- --no-codesign
163- # shopt -s nullglob
164- # IPA_FILES=(build/ios/ipa/*.ipa)
165- # if [ ${#IPA_FILES[@]} -ne 1 ]; then
166- # echo "Error: expected 1 IPA, found ${#IPA_FILES[@]}"
167- # ls -la build/ios/ipa || true
168- # exit 1
169- # fi
170- # IPA_FILE="${IPA_FILES[0]}"
171- # echo "Found IPA: $IPA_FILE"
172- # cp "$IPA_FILE" "${APP_NAME}_${RELEASE_TAG}_ios.ipa"
173- # - name: Create Release
174- # uses: softprops/action-gh-release@v2
175- # with:
176- # files: |
177- # ${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_ios.ipa
178- # env:
179- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180-
181- # releaseMacOS:
182- # name: Release macOS
183- # runs-on: macos-latest
184- # steps:
185- # - name: Checkout
186- # uses: actions/checkout@v6
187- # with:
188- # submodules: recursive
189- # - name: Install Flutter
190- # uses: subosito/flutter-action@v2
191- # - name: Build
192- # run: |
193- # dart run fl_build -p macos -- --no-codesign
194- # - name: Package
195- # run: |
196- # RELEASE_DIR="$GITHUB_WORKSPACE/build/macos/Build/Products/Release"
197- # APP_DIR="$RELEASE_DIR/$APP_NAME.app"
198- # OUT_ZIP="$GITHUB_WORKSPACE/${APP_NAME}_${RELEASE_TAG}_macos.zip"
199-
200- # if [ ! -d "$RELEASE_DIR" ]; then
201- # echo "Error: macOS release directory not found: $RELEASE_DIR"
202- # exit 1
203- # fi
204- # if [ ! -d "$APP_DIR" ]; then
205- # echo "Error: macOS app bundle not found: $APP_DIR"
206- # exit 1
207- # fi
208-
209- # cd "$RELEASE_DIR"
210- # zip -ry "$OUT_ZIP" "$APP_NAME.app"
211- # - name: Create Release
212- # uses: softprops/action-gh-release@v2
213- # with:
214- # files: |
215- # ${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_macos.zip
216- # env:
217- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
0 commit comments