From 4e71b7c19f486dc81b174bf01dd5679be34358d5 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 8 Mar 2023 10:46:15 +0200 Subject: [PATCH] Parallelize Android build, try fix 'no deployed zips' --- .github/workflows/buildAndDeploy.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index e87fb627e9..9d6484b26a 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -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: