Merge pull request #1129 from kkevsekk1/dependabot/gradle/androidx.co… #438
Workflow file for this run
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: Android CI build | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set output | |
id: vars | |
run: | | |
echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: checkout | |
id: check | |
uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Build inrt template | |
run: | | |
chmod 777 ./gradlew | |
./gradlew app:buildTemplateApp | |
- name: Build App | |
run: | | |
./gradlew app:assembleV6 | |
- uses: Tlaster/[email protected] | |
name: Sign app APK | |
with: | |
releaseDirectory: | | |
app/build/outputs/apk/v6/release | |
signingKeyBase64: ${{ secrets.ASIGNING_KEY }} | |
output: build/app/signed | |
alias: ${{ secrets.AALIAS }} | |
keyStorePassword: ${{ secrets.AKEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.AKEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: rename apk | |
run: | | |
cd build/app/signed | |
mv app-v6-arm64-v8a-*.apk Autox-v6-arm64-v8a-release-${{steps.vars.outputs.short_ref}}.apk | |
mv app-v6-armeabi-v7a-*.apk Autox-v6-armeabi-v7a-release-${{steps.vars.outputs.short_ref}}.apk | |
mv app-v6-universal-*.apk Autox-v6-universal-release-${{steps.vars.outputs.short_ref}}.apk | |
ls | |
- name: create-gh-release | |
if: github.repository == 'kkevsekk1/AutoX' | |
uses: taiki-e/create-gh-release-action@v1 | |
with: | |
changelog: CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: create-release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: 'build/app/signed/**' | |
- name: setup aliyun oss | |
if: github.repository == 'kkevsekk1/AutoX' | |
uses: manyuanrong/setup-ossutil@master | |
with: | |
endpoint: oss-cn-hangzhou.aliyuncs.com | |
access-key-id: ${{ secrets.OSS_KEY_ID }} | |
access-key-secret: ${{ secrets.OSS_KEY_SECRET }} | |
- name: update apk to aliyun | |
if: github.repository == 'kkevsekk1/AutoX' | |
run: | | |
ossutil mkdir oss://autoxjsoss/autoxjs/${{ steps.vars.outputs.short_ref }} | |
ossutil cp -rf build/app/signed oss://autoxjsoss/autoxjs/${{ steps.vars.outputs.short_ref }} |