From 2ea163fe7bb3adef668f6b5d3f987b90c9e8a4c2 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Mon, 15 Nov 2021 18:47:11 +0100 Subject: [PATCH 1/2] Integrate building Docker image in release workflow Refs #280 --- .github/workflows/docker.yml | 29 ----------------------------- .github/workflows/release.yml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index ea39a4b2b..000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Docker image -on: - push: - tags: - - '*' -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout SCM - uses: actions/checkout@v2.4.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - name: Set Git tag in output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Build & Push Docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: | - openapitools/openapi-diff:${{ steps.vars.outputs.tag }} - openapitools/openapi-diff:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a21e3a3a..9077b0e07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: with: distribution: 'zulu' java-version: 11 + cache: 'maven' # Value of the distributionManagement/repository/id field of the pom.xml server-id: sonatype-nexus-staging gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} @@ -48,3 +49,24 @@ jobs: run: | ./mvnw -B release:rollback -Prelease -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} echo "You may need to manually delete the GitHub tag, if it was created." + docker: + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + ref: ${{ github.event.inputs.releaseVersion }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build & Push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: | + openapitools/openapi-diff:${{ github.event.inputs.releaseVersion }} + openapitools/openapi-diff:latest From f4913f7582db4b8babe4db7ea12b3c4a5356b374 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Mon, 15 Nov 2021 18:49:25 +0100 Subject: [PATCH 2/2] Remove manual cache step in release job --- .github/workflows/release.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9077b0e07..fc5d8914d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,12 +30,6 @@ jobs: server-username: OSS_USERNAME server-password: OSS_PASSWORD gpg-passphrase: GPG_PASSPHRASE - - uses: actions/cache@v2.1.6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - name: Setup Git run: | git config --global committer.email "noreply@github.com"