172 lines
5.9 KiB
YAML
172 lines
5.9 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
get_tag:
|
|
if: github.repository == 'mihonapp/mihon'
|
|
name: Extract tag name
|
|
runs-on: 'ubuntu-24.04'
|
|
outputs:
|
|
tag: ${{ steps.extract.outputs.tag }}
|
|
|
|
steps:
|
|
- name: Get tag name
|
|
id: extract
|
|
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
if: github.repository == 'mihonapp/mihon'
|
|
name: Build
|
|
runs-on: 'ubuntu-24.04'
|
|
needs: get_tag
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
|
with:
|
|
java-version-file: .github/.java-version
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
|
|
|
|
- name: Build
|
|
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
|
|
|
|
- name: Sign APK
|
|
uses: r0adkll/sign-android-release@a391126403df92c6a0a3988a829dd47f79b89ed7
|
|
with:
|
|
releaseDirectory: app/build/outputs/apk/release
|
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
alias: ${{ secrets.ALIAS }}
|
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
env:
|
|
BUILD_TOOLS_VERSION: '35.0.1'
|
|
|
|
- name: Rename APK
|
|
run: |
|
|
set -e
|
|
|
|
mv app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk mihon-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-arm64-v8a-release-unsigned-signed.apk mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-armeabi-v7a-release-unsigned-signed.apk mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-x86-release-unsigned-signed.apk mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: mihon
|
|
path: |
|
|
mihon-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
|
|
|
|
build_foss:
|
|
if: github.repository == 'mihonapp/mihon'
|
|
name: Build (FOSS)
|
|
runs-on: ubuntu-24.04
|
|
needs: get_tag
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
|
with:
|
|
java-version-file: .github/.java-version
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
|
|
with:
|
|
cache-disabled: true
|
|
|
|
- name: Build
|
|
run: ./gradlew assembleFoss -Penable-updater
|
|
|
|
- name: Sign APK
|
|
uses: r0adkll/sign-android-release@a391126403df92c6a0a3988a829dd47f79b89ed7
|
|
with:
|
|
releaseDirectory: app/build/outputs/apk/foss
|
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
alias: ${{ secrets.ALIAS }}
|
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
env:
|
|
BUILD_TOOLS_VERSION: '35.0.1'
|
|
|
|
- name: Rename APK
|
|
run: |
|
|
set -e
|
|
|
|
mv app/build/outputs/apk/foss/app-universal-foss-unsigned-signed.apk mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: mihon-foss
|
|
path: mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
|
|
|
|
release:
|
|
if: github.repository == 'mihonapp/mihon'
|
|
name: Create GitHub Release
|
|
runs-on: ubuntu-24.04
|
|
needs: [get_tag, build, build_foss]
|
|
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
|
with:
|
|
merge-multiple: true
|
|
|
|
- name: Delete all artifacts
|
|
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
|
|
with:
|
|
failOnError: false
|
|
name: |
|
|
mihon
|
|
mihon-foss
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
|
|
with:
|
|
tag_name: ${{ needs.get_tag.outputs.tag }}
|
|
name: Mihon ${{ needs.get_tag.outputs.tag }}
|
|
body: |
|
|
Check out the [past release notes](https://github.com/mihonapp/mihon/releases) if you're upgrading from an earlier version. Consider [becoming a patron](https://www.patreon.com/mihon/membership) to help keep Mihon improving!
|
|
|
|
<!-->
|
|
|
|
|
|
|
|
<!-->
|
|
|
|
> [!TIP]
|
|
>
|
|
> ### If you are unsure which version to download then go with `mihon-${{ needs.get_tag.outputs.tag }}.apk`
|
|
files: |
|
|
mihon-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
|
|
mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
|
|
mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
|
|
draft: true
|
|
prerelease: false
|
|
token: ${{ secrets.MIHON_BOT_TOKEN }}
|