From f98ee51cc5658fb19f29ced0448c8ccebd4eea8a Mon Sep 17 00:00:00 2001 From: Mike Hansen Date: Tue, 16 Jun 2020 09:36:44 -0400 Subject: [PATCH] Try if: always() to ensure completion, regardless of whether install performed, re-enabled check for existing binary --- .github/workflows/maven-build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 93150fc..98aa0e3 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -27,7 +27,10 @@ jobs: with: path: ~/protobuf-2.6.1-bin key: ${{ runner.os }}-protobuf - - name: Build protobuf binary + - name: Check if protobuf compiler binary is present + run: ls /home/runner/protobuf-2.6.1-bin/bin/protoc + - name: Build protobuf binary if needed + if: failure() # previous step failed - protoc file is not present run: | curl -L -O https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz tar xf protobuf-2.6.1.tar.gz @@ -37,15 +40,18 @@ jobs: make protoc make install - name: Configure ~/.m2/toolchains.xml file + if: always() run: | cp toolchains.xml ~/.m2/toolchains.xml - name: Build with Maven - test + if: always() run: mvn -B --file pom.xml verify # Ensure all artifacts build successfully before we attempt deploy in order to prevent partial deploys. env: MAVEN_REPO_USERNAME: build-pipeline MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }} - name: Build with Maven - deploy + if: always() run: mvn -B --file pom.xml -DskipTests deploy # Now that all builds have completed, we can deploy all the artifacts. env: