Release Published #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Published | |
on: | |
workflow_dispatch: | |
release: | |
types: [ created, edited ] | |
jobs: | |
gradle_build: | |
uses: ./.github/workflows/sub_gradle_build.yml | |
# essential_tests: | |
# needs: [ gradle_build ] | |
# uses: ./.github/workflows/sub_essential_tests.yml | |
# | |
# extended_tests: | |
# needs: [ gradle_build ] | |
# uses: ./.github/workflows/sub_extended_tests.yml | |
# | |
codeql_analysis: | |
uses: ./.github/workflows/sub_codeql_analysis.yml | |
build_and_push_docker_image: | |
# needs: [ gradle_build, essential_tests, extended_tests, codeql_analysis ] | |
needs: [ gradle_build, codeql_analysis ] | |
name: Push to DockerHub (tag=stellar/anchor-platform:${{ github.event.release.tag_name }}) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get EXPECTED_RELEASE_TAG | |
shell: bash | |
run: | | |
echo "EXPECTED_RELEASE_TAG=$(${{github.workspace}}/gradlew -q printVersionName)" | |
echo "EXPECTED_RELEASE_TAG=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV | |
- name: Fail if the release version and the project version do not match | |
if: ${{ github.event.release.tag_name != env.EXPECTED_RELEASE_TAG }} | |
run: | | |
echo "The release tag is invalid: [${{ github.event.release.tag_name }}]" | |
echo "The expected release tag is: [${{ env.EXPECTED_RELEASE_TAG }}]" | |
echo "The release tag must match project version." | |
exit 1 | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker images | |
uses: docker/[email protected] | |
with: | |
push: true | |
tags: stellar/anchor-platform:${{ env.EXPECTED_RELEASE_TAG }},stellar/anchor-platform:latest | |
file: Dockerfile | |
complete: | |
if: always() | |
# needs: [ essential_tests, extended_tests, build_and_push_docker_image ] | |
needs: [ build_and_push_docker_image ] | |
runs-on: ubuntu-latest | |
steps: | |
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: exit 1 |