Parallelize Android build, try fix 'no deployed zips'

This commit is contained in:
Yair Morgenstern
2023-03-08 10:46:15 +02:00
parent 66a2e676d3
commit 4e71b7c19f

View File

@ -15,9 +15,7 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Build:
# On push events only, if it's a "Update X" commit, it's probably something done through the UI -
# so an .md or yaml change, and not something we need to rebuild over
@ -29,9 +27,7 @@ jobs:
version_tag: ${{ steps.tag.outputs.tag }}
release_body: ${{steps.read_release.outputs.release_body}}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
@ -112,13 +108,28 @@ jobs:
## ANDROID
android-build:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: Build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.3.3
- name: Prepare .aab (for Google Play) and .apk (for Github) files
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
mkdir whatsNewDirectory
echo "${{steps.read_release.outputs.release_body}}" > whatsNewDirectory/whatsnew-en-US
echo "${{needs.Build.outputs.release_body}}" > whatsNewDirectory/whatsnew-en-US
./gradlew :android:bundleRelease
./gradlew :android:assembleRelease
@ -202,7 +213,7 @@ jobs:
packr-build:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build
needs: Build
steps:
- uses: actions/checkout@v3
@ -224,8 +235,9 @@ jobs:
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
mkdir deploy
mkdir -p desktop/build/libs
mv Unciv.jar desktop/build/libs
mv UncivJar/Unciv.jar desktop/build/libs
wget -q -O packr-all-4.0.0.jar https://github.com/libgdx/packr/releases/download/4.0.0/packr-all-4.0.0.jar
wget -q -O jre-linux-64.tar.gz https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.11_9.tar.gz
@ -302,7 +314,7 @@ jobs:
releaseBranch: release
Finalize:
needs: packr-build
needs: [android-build, packr-build]
runs-on: ubuntu-latest
steps: