165 lines
5.5 KiB
YAML
165 lines
5.5 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
MIHON_GITHUB_RELEASE: true
|
|
|
|
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
|
|
with:
|
|
java-version-file: .github/.java-version
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
|
|
|
|
- name: Build
|
|
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
|
|
env:
|
|
storeFileBase64: ${{ secrets.SIGNING_KEY }}
|
|
storePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
keyAlias: ${{ secrets.ALIAS }}
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
|
|
- name: Rename APK
|
|
run: |
|
|
set -e
|
|
|
|
mv app/build/outputs/apk/release/app-universal-release.apk mihon-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-arm64-v8a-release.apk mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-armeabi-v7a-release.apk mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-x86-release.apk mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
|
|
mv app/build/outputs/apk/release/app-x86_64-release.apk mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
|
|
with:
|
|
java-version-file: .github/.java-version
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
|
|
with:
|
|
cache-disabled: true
|
|
|
|
- name: Build
|
|
run: ./gradlew assembleFoss -Penable-updater
|
|
env:
|
|
storeFileBase64: ${{ secrets.SIGNING_KEY }}
|
|
storePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
keyAlias: ${{ secrets.ALIAS }}
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
|
|
- name: Rename APK
|
|
run: |
|
|
set -e
|
|
|
|
mv app/build/outputs/apk/foss/app-universal-foss.apk mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
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@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
merge-multiple: true
|
|
|
|
- name: Delete all artifacts
|
|
uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0
|
|
with:
|
|
failOnError: false
|
|
name: |
|
|
mihon
|
|
mihon-foss
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
|
|
with:
|
|
tag_name: ${{ needs.get_tag.outputs.tag }}
|
|
name: Mihon ${{ needs.get_tag.outputs.tag }}
|
|
body: |
|
|
Consider supporting the development on [Patreon](https://www.patreon.com/mihon/membership) or [OpenCollective](https://opencollective.com/mihon/contribute) to keep Mihon improving!
|
|
|
|
Check out the [past release notes](https://github.com/mihonapp/mihon/releases) if you're upgrading from an earlier version.
|
|
|
|
<!-->
|
|
|
|
|
|
|
|
<!-->
|
|
|
|
> [!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 }}
|