Mieru Plugin Build #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mieru Plugin Build | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Release Tag" | |
required: true | |
publish: | |
description: "Publish: If want ignore" | |
required: false | |
jobs: | |
native: | |
name: Native Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Fetch Status | |
run: git submodule status 'plugin/mieru/*' > mieru_status | |
- name: Mieru Cache | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
plugin/mieru/src/main/jniLibs | |
key: ${{ hashFiles('.github/workflows/*', 'bin/lib/mieru/*', 'mieru_status') }} | |
- name: Gradle cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle | |
key: gradle-${{ hashFiles('**/*.gradle.kts') }} | |
- name: Golang Version | |
if: steps.cache.outputs.cache-hit != 'true' | |
id: version | |
run: | | |
source buildScript/init/version.sh | |
echo go_version=$GO_VERSION >> $GITHUB_OUTPUT | |
- name: Install Golang | |
uses: actions/setup-go@v5 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
go-version: ${{ steps.version.outputs.go_version }} | |
- name: Native Build | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: ./run plugin mieru | |
build: | |
name: Gradle Build | |
runs-on: ubuntu-latest | |
needs: | |
- native | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Fetch Status | |
run: git submodule status 'plugin/mieru/*' > mieru_status | |
- name: Mieru Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
plugin/mieru/src/main/jniLibs | |
key: ${{ hashFiles('.github/workflows/*', 'bin/lib/mieru/*', 'mieru_status') }} | |
- name: Gradle cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle | |
key: gradle-${{ hashFiles('**/*.gradle.kts') }} | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
- name: Release Build | |
env: | |
SKIP_BUILD: on | |
BUILD_PLUGIN: mieru | |
run: | | |
echo "sdk.dir=${ANDROID_HOME}" > local.properties | |
# export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" | |
KEYSTORE_PASS="${{ secrets.KEYSTORE_PASS }}" ALIAS_NAME="${{ secrets.ALIAS_NAME }}" ALIAS_PASS="${{ secrets.ALIAS_PASS}}" ./gradlew :plugin:mieru:assembleFossRelease | |
APK=$(find plugin/mieru/build/outputs/apk -name '*arm64-v8a*.apk') | |
APK=$(dirname "$APK") | |
echo "APK=$APK" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: APKs | |
path: ${{ env.APK }} | |
publish: | |
name: Publish Release | |
if: github.event.inputs.publish != 'y' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Donwload Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: APKs | |
path: artifacts | |
- name: Release | |
run: | | |
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.16.2/ghr_v0.16.2_linux_amd64.tar.gz | |
tar -xvf ghr.tar.gz | |
mv ghr*linux_amd64/ghr . | |
mkdir apks | |
find artifacts -name "*.apk" -exec cp {} apks \; | |
find artifacts -name "*.sha256sum.txt" -exec cp {} apks \; | |
./ghr -delete -prerelease -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks |