mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 05:57:29 +01:00
Tweak build and release actions (#2367)
This commit is contained in:
171
.github/workflows/release.yml
vendored
Normal file
171
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: temurin
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
|
||||
|
||||
- name: Sign APK
|
||||
uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478
|
||||
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: temurin
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
|
||||
with:
|
||||
cache-disabled: true
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew assembleFoss -Penable-updater
|
||||
|
||||
- name: Sign APK
|
||||
uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478
|
||||
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.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@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.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 [donating via Open Collective](https://opencollective.com/mihon/contribute) 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 }}
|
||||
Reference in New Issue
Block a user