Try if: always() to ensure completion, regardless of whether install performed, re-enabled check for existing binary

This commit is contained in:
Mike Hansen
2020-06-16 09:36:44 -04:00
parent 4eee55557b
commit f98ee51cc5

View File

@@ -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: