Skip to content

Fixed logic updating workflow. [skip CI] #1446

Fixed logic updating workflow. [skip CI]

Fixed logic updating workflow. [skip CI] #1446

Workflow file for this run

name: Android
on:
push:
branches: [ main ]
tags: 'v*.*.*'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || (!contains(github.event.head_commit.message, '[skip CI]') && !contains(github.event.head_commit.message, '[skip Android]'))"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Generate Lua bindings
run: |
sudo apt-get install lua5.1
sudo apt-get install -y luarocks
sudo luarocks install luafilesystem
cd ./Tools/tolua++
lua tolua++.lua
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- name: Build Android
if: "!startsWith(github.ref, 'refs/tags/')"
run: cd Projects/Android/Dora && ./gradlew assembleDebug
- name: Pack Android
if: startsWith(github.ref, 'refs/tags/')
run: |
cd Tools/dora-dora/3rdParty/YarnEditor && yarn && yarn build-linux && rm -rf ../../public/yarn-editor && mv dist ../../public/yarn-editor && cd ../../../..
cd Tools/dora-dora && yarn && yarn build && cd ../.. && rm -rf Assets/www && mv Tools/dora-dora/build Assets/www
echo "${{ secrets.KEYSTORE_B64 }}" | base64 -d > $GITHUB_WORKSPACE/signing-key.jks
cd Projects/Android/Dora
./gradlew assembleRelease -Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/signing-key.jks -Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }}
cd app/build/outputs/apk/release
mv app-release.apk dora-ssr-${{ github.ref_name }}-android.apk
zip dora-ssr-${{ github.ref_name }}-android.zip dora-ssr-${{ github.ref_name }}-android.apk
mv dora-ssr-${{ github.ref_name }}-android.zip $GITHUB_WORKSPACE/dora-ssr-${{ github.ref_name }}-android.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dora-ssr-${{ github.ref_name }}-android.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}