From 38e20e8afab514db808692a0c257cd3540bb74e5 Mon Sep 17 00:00:00 2001 From: mazano Date: Tue, 15 Oct 2024 16:53:27 +0200 Subject: [PATCH] [skip-release] Add action to publish release artifacts (#692) * Add action to publish release artifacts and fix action logic --- .github/workflows/build-latest.yaml | 30 +++++++++++++------- .github/workflows/deploy-image.yaml | 41 +++++++++++++++++++++++++-- clustering/activemq-docker/Dockerfile | 10 +++---- 3 files changed, 64 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-latest.yaml b/.github/workflows/build-latest.yaml index 3806d1ab..1c49a93c 100644 --- a/.github/workflows/build-latest.yaml +++ b/.github/workflows/build-latest.yaml @@ -25,8 +25,10 @@ jobs: timeout-minutes: 5 if: | github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) steps: - uses: actions/checkout@v4 - name: Set up QEMU @@ -58,8 +60,10 @@ jobs: timeout-minutes: 15 if: | github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) strategy: matrix: geoserverMajorVersion: @@ -135,8 +139,10 @@ jobs: timeout-minutes: 20 if: | github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) needs: [build-geoserver-docker-image, run-scenario-tests] steps: - uses: actions/checkout@v4 @@ -168,8 +174,10 @@ jobs: timeout-minutes: 20 if: | github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) needs: [ build-geoserver-docker-image, build-activemq-docker-image] strategy: matrix: @@ -216,8 +224,10 @@ jobs: github.event_name == 'pull_request' && github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url && github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) runs-on: ubuntu-latest timeout-minutes: 20 needs: [ build-geoserver-docker-image, run-scenario-tests ] diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml index 5553f4f2..86bb5fa3 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/deploy-image.yaml @@ -14,8 +14,10 @@ jobs: deploy-image: if: | github.actor != 'dependabot[bot]' && - (!contains(github.event.comment.body, '/skiprelease') || - !contains(github.event.comment.title, '[skiprelease]')) + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) && github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest timeout-minutes: 15 env: @@ -78,4 +80,39 @@ jobs: cache-to: type=gha,scope=prod target: geoserver-prod + publish_release_artifacts: + runs-on: ubuntu-latest + timeout-minutes: 5 + if: | + github.actor != 'dependabot[bot]' && + !( + contains(github.event.pull_request.title, '[skip-release]') || + contains(github.event.comment.body, '/skiprelease') + ) && github.event.workflow_run.conclusion == 'success' + needs: [deploy-image] + strategy: + matrix: + geoserverMajorVersion: + - 2 + geoserverMinorVersion: + - minor: 25 + patch: 2 + steps: + - name: Get Current Date + id: current_date + run: echo "formatted=$(date -u +%Y.%m.%d)" >> $GITHUB_OUTPUT + + - name: Get Latest Commit Hash + id: latest_commit_hash + run: echo "commit=$(git log -n 1 --pretty=format:%H)" >> $GITHUB_OUTPUT + + - name: publish_release + id: tag_releases + run: | + gh release create v${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}--v${{ steps.current_date.outputs.formatted }}--${{ steps.latest_commit_hash.outputs.commit }} --generate-notes --target ${{ steps.latest_commit_hash.outputs.commit }} --repo $GITHUB_REPOSITORY + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + diff --git a/clustering/activemq-docker/Dockerfile b/clustering/activemq-docker/Dockerfile index bb78c46a..56e69773 100644 --- a/clustering/activemq-docker/Dockerfile +++ b/clustering/activemq-docker/Dockerfile @@ -2,11 +2,11 @@ FROM bellsoft/liberica-openjdk-alpine:13 AS activemq-prod LABEL maintainer="Alessio Fabiani " -ENV ACTIVEMQ_VERSION 5.17.1 -ENV ACTIVEMQ apache-activemq-$ACTIVEMQ_VERSION -ENV ACTIVEMQ_HOME /opt/activemq/ -ENV ACTIVEMQ_CONF $ACTIVEMQ_HOME/conf/ -ENV ACTIVEMQ_LIB $ACTIVEMQ_HOME/lib/optional/ +ENV ACTIVEMQ_VERSION=5.17.1 +ENV ACTIVEMQ=apache-activemq-$ACTIVEMQ_VERSION +ENV ACTIVEMQ_HOME=/opt/activemq/ +ENV ACTIVEMQ_CONF=$ACTIVEMQ_HOME/conf/ +ENV ACTIVEMQ_LIB=$ACTIVEMQ_HOME/lib/optional/ RUN apk add --update curl && \