release.yml
.github/workflows/release.yml
1name: Manual Release2run-name: Release ${{ inputs.release_tag }}34on:5 workflow_dispatch:6 inputs:7 release_tag:8 description: Existing Forgejo release tag to build (e.g. v0.1.0)9 required: true10 type: string11 android:12 description: Android signed APK13 type: boolean14 default: true15 linux:16 description: Linux DEB and AppImage17 type: boolean18 default: true19 macos:20 description: macOS DMG (higher runner cost)21 type: boolean22 default: true23 windows:24 description: Windows MSI25 type: boolean26 default: true27 ios:28 description: iOS unsigned IPA with Zero runtime (higher runner cost)29 type: boolean30 default: true31 ios_framework:32 description: iOS framework ZIP (reuses IPA compilation when both are selected)33 type: boolean34 default: true35 rebuild_existing:36 description: Rebuild and replace selected assets that already exist37 type: boolean38 default: false3940# Keep only the latest manual release request running, across all tags.41concurrency:42 group: yokan-manual-release43 cancel-in-progress: true4445permissions:46 contents: read4748env:49 RELEASE_TAG: ${{ inputs.release_tag }}50 YOKAN_VERSION: ${{ inputs.release_tag }}51 GH_REPO: ${{ github.repository }}52 GH_TOKEN: ${{ github.token }}53 REBUILD_EXISTING: ${{ inputs.rebuild_existing }}5455jobs:56 prepare:57 runs-on: ubuntu-latest58 timeout-minutes: 559 permissions:60 contents: write61 outputs:62 commit: ${{ steps.release.outputs.commit }}63 channel: ${{ steps.release.outputs.channel }}64 prerelease: ${{ steps.release.outputs.prerelease }}65 android: ${{ steps.release.outputs.android }}66 linux: ${{ steps.release.outputs.linux }}67 macos: ${{ steps.release.outputs.macos }}68 windows: ${{ steps.release.outputs.windows }}69 ios: ${{ steps.release.outputs.ios }}70 ios_framework: ${{ steps.release.outputs.ios_framework }}71 steps:72 - uses: actions/checkout@v773 with:74 persist-credentials: false75 - name: Test release scripts76 run: python3 .github/scripts/test_release_scripts.py77 - name: Validate tag and select missing assets78 id: release79 env:80 FORGEJO_USERNAME: ${{ secrets.FORGEJO_USERNAME }}81 FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}82 ANDROID: ${{ inputs.android }}83 LINUX: ${{ inputs.linux }}84 MACOS: ${{ inputs.macos }}85 WINDOWS: ${{ inputs.windows }}86 IOS: ${{ inputs.ios }}87 IOS_FRAMEWORK: ${{ inputs.ios_framework }}88 run: bash .github/scripts/prepare-release.sh8990 - name: Validate Android signing credentials before starting any builds91 if: steps.release.outputs.android == 'true'92 shell: bash93 env:94 ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}95 ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}96 ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}97 ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}98 run: |99 for name in ANDROID_KEYSTORE_BASE64 ANDROID_KEYSTORE_PASSWORD ANDROID_KEY_ALIAS ANDROID_KEY_PASSWORD; do100 test -n "${!name}" || { echo "Missing signing secret: $name" >&2; exit 1; }101 done102103 android:104 needs: prepare105 if: needs.prepare.outputs.android == 'true'106 runs-on: ubuntu-latest107 timeout-minutes: 30108 permissions:109 contents: write110 steps:111 - uses: actions/checkout@v7112 with:113 persist-credentials: false114 - uses: ./.github/actions/release-setup115 with:116 commit: ${{ needs.prepare.outputs.commit }}117 forgejo-username: ${{ secrets.FORGEJO_USERNAME }}118 forgejo-token: ${{ secrets.FORGEJO_TOKEN }}119 - name: Build release APK120 working-directory: source121 run: ./gradlew :androidApp:assembleRelease -Pyokan.version="$YOKAN_VERSION" --no-daemon122 - name: Sign and upload directly to release123 shell: bash124 working-directory: source125 env:126 ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}127 ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}128 ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}129 ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}130 run: |131 mkdir -p release132 bash scripts/sign-android-apk.sh androidApp/build/outputs/apk/release/androidApp-release-unsigned.apk "release/Yokan-$RELEASE_TAG-android.apk"133 bash ../.github/scripts/upload-release-assets.sh release/*.apk134135 linux:136 needs: prepare137 if: needs.prepare.outputs.linux == 'true'138 runs-on: ubuntu-latest139 timeout-minutes: 30140 permissions:141 contents: write142 steps:143 - uses: actions/checkout@v7144 with:145 persist-credentials: false146 - uses: ./.github/actions/release-setup147 with:148 commit: ${{ needs.prepare.outputs.commit }}149 forgejo-username: ${{ secrets.FORGEJO_USERNAME }}150 forgejo-token: ${{ secrets.FORGEJO_TOKEN }}151 - name: Install packaging dependencies152 run: sudo apt-get update && sudo apt-get install -y fakeroot dpkg-dev153 - name: Build and upload Linux packages154 shell: bash155 working-directory: source156 run: |157 ./gradlew :composeApp:packageReleaseDeb :composeApp:createReleaseDistributable -Pyokan.version="$YOKAN_VERSION" --no-daemon158 mkdir -p release159 cp composeApp/build/compose/binaries/main-release/deb/*.deb "release/Yokan-$RELEASE_TAG-linux.deb"160 bash scripts/build-linux-appimage.sh "release/Yokan-$RELEASE_TAG-linux.AppImage"161 bash ../.github/scripts/upload-release-assets.sh release/*162163 macos:164 needs: prepare165 if: needs.prepare.outputs.macos == 'true'166 runs-on: macos-latest167 timeout-minutes: 30168 permissions:169 contents: write170 steps:171 - uses: actions/checkout@v7172 with:173 persist-credentials: false174 - uses: ./.github/actions/release-setup175 with:176 commit: ${{ needs.prepare.outputs.commit }}177 forgejo-username: ${{ secrets.FORGEJO_USERNAME }}178 forgejo-token: ${{ secrets.FORGEJO_TOKEN }}179 - name: Build and upload macOS DMG180 working-directory: source181 run: |182 ./gradlew :composeApp:packageReleaseDmg -Pyokan.version="$YOKAN_VERSION" --no-daemon183 mkdir -p release184 cp composeApp/build/compose/binaries/main-release/dmg/*.dmg "release/Yokan-$RELEASE_TAG-macos.dmg"185 bash ../.github/scripts/upload-release-assets.sh release/*186187 windows:188 needs: prepare189 if: needs.prepare.outputs.windows == 'true'190 runs-on: windows-latest191 timeout-minutes: 30192 permissions:193 contents: write194 steps:195 - uses: actions/checkout@v7196 with:197 persist-credentials: false198 - uses: ./.github/actions/release-setup199 with:200 commit: ${{ needs.prepare.outputs.commit }}201 forgejo-username: ${{ secrets.FORGEJO_USERNAME }}202 forgejo-token: ${{ secrets.FORGEJO_TOKEN }}203 - name: Build and upload Windows MSI204 shell: bash205 working-directory: source206 run: |207 ./gradlew :composeApp:packageReleaseMsi -Pyokan.version="$YOKAN_VERSION" --no-daemon208 mkdir -p release209 cp composeApp/build/compose/binaries/main-release/msi/*.msi "release/Yokan-$RELEASE_TAG-windows.msi"210 bash ../.github/scripts/upload-release-assets.sh release/*211212 ios:213 needs: prepare214 if: needs.prepare.outputs.ios == 'true' || needs.prepare.outputs.ios_framework == 'true'215 # The arm64 hosted runner has insufficient memory for this release framework.216 runs-on: macos-26-intel217 timeout-minutes: 45218 permissions:219 contents: write220 steps:221 - uses: actions/checkout@v7222 with:223 persist-credentials: false224 - uses: ./.github/actions/release-setup225 with:226 commit: ${{ needs.prepare.outputs.commit }}227 forgejo-username: ${{ secrets.FORGEJO_USERNAME }}228 forgejo-token: ${{ secrets.FORGEJO_TOKEN }}229 - name: Build IPA including Zero interpreter and extension server230 if: needs.prepare.outputs.ios == 'true'231 working-directory: source232 env:233 YOKAN_SIDELOAD_RUNTIME: 'YES'234 run: |235 scripts/build-ios-unsigned-ipa.sh236 mkdir -p release237 cp build/ios-ipa/dist/*.ipa "release/Yokan-$RELEASE_TAG-ios-unsigned.ipa"238 - name: Compile standalone framework when no IPA build is needed239 if: needs.prepare.outputs.ios != 'true' && needs.prepare.outputs.ios_framework == 'true'240 working-directory: source241 run: ./gradlew :composeApp:linkReleaseFrameworkIosArm64 -Pyokan.version="$YOKAN_VERSION" --no-daemon242 - name: Package framework from the same compilation243 if: needs.prepare.outputs.ios_framework == 'true'244 working-directory: source245 run: |246 mkdir -p release247 ditto -c -k --sequesterRsrc --keepParent composeApp/build/bin/iosArm64/releaseFramework/YokanShared.framework "release/Yokan-$RELEASE_TAG-ios-framework.zip"248 - name: Upload iOS assets directly to release249 working-directory: source250 run: bash ../.github/scripts/upload-release-assets.sh release/*251252 publish:253 needs: [prepare, android, linux, macos, windows, ios]254 if: >-255 ${{ !cancelled() && needs.prepare.result == 'success' &&256 !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}257 runs-on: ubuntu-latest258 timeout-minutes: 5259 permissions:260 contents: write261 steps:262 - name: Publish selected release after all selected builds succeed263 env:264 CHANNEL: ${{ needs.prepare.outputs.channel }}265 PRERELEASE: ${{ needs.prepare.outputs.prerelease }}266 run: |267 gh release edit "$RELEASE_TAG" --repo "$GH_REPO" --draft=false --prerelease="$PRERELEASE" --title "Yokan $RELEASE_TAG ($CHANNEL)"268 gh release view "$RELEASE_TAG" --repo "$GH_REPO" --json url --jq .url >> "$GITHUB_STEP_SUMMARY"269