From 400863f78d2b7fc7dffcf2c538c267915828351a Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Fri, 23 Aug 2024 15:04:28 +0100 Subject: [PATCH 01/10] Add publish-hotfix-release.yml --- .github/workflows/publish-hotfix-release.yml | 222 +++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 .github/workflows/publish-hotfix-release.yml diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml new file mode 100644 index 000000000..7e12a60e0 --- /dev/null +++ b/.github/workflows/publish-hotfix-release.yml @@ -0,0 +1,222 @@ +################################################################################# +# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################# + + +--- +name: "Publish hotfix release" + +# Temporary workflow to enable the release of bugfix versions. +# Should be reworked as this file contains duplicate code from draft-new-release and publish-new-release + +on: + workflow_dispatch: + inputs: + version: + description: 'The hotfix version you want to release.' + required: true + +jobs: + # Gate: Check release version presence + validate-release: + name: Validate if hotfix can be released + runs-on: ubuntu-latest + if: startsWith(github.ref_name, 'hotfix/') + steps: + - uses: mukunku/tag-exists-action@v1.6.0 + id: check-tag + with: + tag: ${{ inputs.version }} + + - if: steps.check-tag.outputs.exists == 'true' + name: Exit on tag existance + run: | + echo "Tag already exists! Please choose another tag." + exit 1 + + release-version: + name: Determine release version + needs: [validate-release] + runs-on: ubuntu-latest + outputs: + RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }} + steps: + - name: Output release version + id: release-version + run: | + echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT + + # Release: Maven Artifacts + maven-release: + name: Publish extension's release version to maven repository + needs: [ release-version ] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + if: needs.release-version.outputs.RELEASE_VERSION + steps: + - name: Export RELEASE_VERSION env + run: | + echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV + + # Set-Up + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-java + + # Import GPG Key + - uses: ./.github/actions/import-gpg-key + name: "Import GPG Key" + with: + gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} + + # publish releases + - name: Publish version + env: + OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} + OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} + run: |- + echo "Publishing Version $RELEASE_VERSION to Sonatype/MavenCentral" + ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Pversion=$RELEASE_VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" + + docker-release: + name: Publish Docker images + runs-on: ubuntu-latest + needs: [ release-version ] + permissions: + contents: write + if: needs.release-version.outputs.RELEASE_VERSION + + strategy: + fail-fast: false + matrix: + variant: [ { dir: edc-controlplane, img: edc-runtime-memory }, + { dir: edc-controlplane, img: edc-controlplane-postgresql-hashicorp-vault }, + { dir: edc-controlplane, img: edc-controlplane-postgresql-azure-vault }, + { dir: edc-dataplane, img: edc-dataplane-azure-vault }, + { dir: edc-dataplane, img: edc-dataplane-hashicorp-vault }, + { dir: edc-tests/runtime, img: mock-connector }] + steps: + - uses: actions/checkout@v4 + - name: Export RELEASE_VERSION env + run: | + echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV + - uses: ./.github/actions/publish-docker-image + name: Publish ${{ matrix.variant.img }} + with: + docker_tag: ${{ env.RELEASE_VERSION }} + rootDir: ${{ matrix.variant.dir }}/${{ matrix.variant.img }} + imagename: ${{ matrix.variant.img }} + docker_user: ${{ secrets.DOCKER_HUB_USER }} + docker_token: ${{ secrets.DOCKER_HUB_TOKEN }} + do_push: 'true' + + # Release: Helm Charts + helm-release: + name: Publish new helm release + needs: [ release-version ] + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + pages: write + + if: needs.release-version.outputs.RELEASE_VERSION + steps: + - name: Export RELEASE_VERSION env + run: | + echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.8.1 + - name: Package helm, update index.yaml and push to gh-pages + run: | + # Prepare git env + git config user.name "eclipse-tractusx-bot" + git config user.email "tractusx-bot@eclipse.org" + + # Package all charts + find charts -name Chart.yaml -not -path "./edc-tests/*" | xargs -n1 dirname | xargs -n1 helm package -u -d helm-charts + + git checkout gh-pages || git checkout -b gh-pages + git pull --rebase origin gh-pages + + # Generate helm repo index.yaml + helm repo index . --merge index.yaml --url https://${GITHUB_REPOSITORY_OWNER}.github.io/${GITHUB_REPOSITORY#*/}/ + + # Commit and push to gh-pages + git add index.yaml helm-charts + git commit -s -m "Release ${{ env.RELEASE_VERSION }}" + + git push origin gh-pages + + # Release: GitHub tag & release; Merges back releases into main; Starts a new development cycle; + github-release: + name: Publish new github release + needs: [ release-version, maven-release, docker-release, helm-release ] + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + pages: write + pull-requests: write + if: needs.release-version.outputs.RELEASE_VERSION + steps: + - name: Export RELEASE_VERSION env + run: | + echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + # 0 to fetch the full history due to upcoming merge of releases into main branch + fetch-depth: 0 + - name: Create Release Tag + id: create_release_tag + run: | + # Prepare git env + git config user.name "eclipse-tractusx-bot" + git config user.email "tractusx-bot@eclipse.org" + + # informative + git branch -a + git tag + + # Create & push tag + git tag --force ${{ env.RELEASE_VERSION }} + git push --force origin ${{ env.RELEASE_VERSION }} + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: ${{ env.RELEASE_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + makeLatest: false + removeArtifacts: true + + publish-to-swaggerhub: + name: "Publish OpenAPI spec to Swaggerhub" + permissions: + contents: read + needs: [ release-version ] + uses: ./.github/workflows/publish-swaggerhub.yaml + with: + downstream-version: ${{ needs.release-version.outputs.RELEASE_VERSION }} + secrets: inherit From 9b7453ff2ca9a7d8398c4fce63bbd9039ec03262 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Fri, 23 Aug 2024 15:21:55 +0100 Subject: [PATCH 02/10] Adds prepare-hotfix-release job --- .github/workflows/publish-hotfix-release.yml | 55 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index 7e12a60e0..4da9e0166 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -23,6 +23,7 @@ name: "Publish hotfix release" # Temporary workflow to enable the release of bugfix versions. # Should be reworked as this file contains duplicate code from draft-new-release and publish-new-release +# This workflow, as is, should be executed after the hotfix branch is created and all needed PRs are merged on: workflow_dispatch: @@ -61,10 +62,54 @@ jobs: run: | echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT + prepare-hotfix-release: + name: "Prepare hotfix release" + runs-on: ubuntu-latest + needs: [release-version] + permissions: + contents: write + packages: write + pages: write + pull-requests: write + if: needs.release-version.outputs.RELEASE_VERSION + steps: + - uses: actions/checkout@v4 + - name: Initialize mandatory git config + run: | + git config user.name "eclipse-tractusx-bot" + git config user.email "tractusx-bot@eclipse.org" + - uses: ./.github/actions/setup-java + - name: Bump version in gradle.properties + run: |- + # replace the project's (default) version, could be overwritten later with the -Pversion=... flag + sed -i 's/version=.*/version=${{ needs.release-version.outputs.RELEASE_VERSION }}/g' gradle.properties + env: + GITHUB_PACKAGE_USERNAME: ${{ github.actor }} + GITHUB_PACKAGE_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + - name: Bump version in /charts + uses: mikefarah/yq@v4.44.2 + with: + cmd: |- + find charts -name Chart.yaml -maxdepth 3 | xargs -n1 yq -i '.appVersion = "${{ needs.release-version.outputs.RELEASE_VERSION }}" | .version = "${{ needs.release-version.outputs.RELEASE_VERSION }}"' + - name: Update Chart READMEs + uses: addnab/docker-run-action@v3 + with: + image: jnorwood/helm-docs:v1.10.0 + options: -v ${{ github.workspace }}/charts:/helm-docs + run: | + helm-docs --log-level debug + - name: Commit manifest files + id: make-commit + run: | + git add gradle.properties $(find charts -name Chart.yaml) $(find charts -name README.md) + git commit --message "Prepare release ${{ needs.release-version.outputs.RELEASE_VERSION }}" + + echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + # Release: Maven Artifacts maven-release: name: Publish extension's release version to maven repository - needs: [ release-version ] + needs: [ prepare-hotfix-release, release-version ] runs-on: ubuntu-latest permissions: contents: read @@ -97,7 +142,7 @@ jobs: docker-release: name: Publish Docker images runs-on: ubuntu-latest - needs: [ release-version ] + needs: [ prepare-hotfix-release, release-version ] permissions: contents: write if: needs.release-version.outputs.RELEASE_VERSION @@ -129,7 +174,7 @@ jobs: # Release: Helm Charts helm-release: name: Publish new helm release - needs: [ release-version ] + needs: [ prepare-hotfix-release, release-version ] runs-on: ubuntu-latest permissions: contents: write @@ -172,7 +217,7 @@ jobs: # Release: GitHub tag & release; Merges back releases into main; Starts a new development cycle; github-release: name: Publish new github release - needs: [ release-version, maven-release, docker-release, helm-release ] + needs: [ prepare-hotfix-release, release-version, maven-release, docker-release, helm-release ] runs-on: ubuntu-latest permissions: contents: write @@ -215,7 +260,7 @@ jobs: name: "Publish OpenAPI spec to Swaggerhub" permissions: contents: read - needs: [ release-version ] + needs: [ prepare-hotfix-release, release-version ] uses: ./.github/workflows/publish-swaggerhub.yaml with: downstream-version: ${{ needs.release-version.outputs.RELEASE_VERSION }} From dab1246f08c182190f8b4cb9ad9c19e3f0e557a2 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 10:13:16 +0100 Subject: [PATCH 03/10] Fix Copyright header --- .github/workflows/publish-hotfix-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index 4da9e0166..1870c9343 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -1,5 +1,5 @@ ################################################################################# -# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation +# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. From 3766971cc9ac180aa7bd43f8a0e8b7fef0ab21b3 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 12:50:21 +0100 Subject: [PATCH 04/10] Replace unecessary check-tag action --- .github/workflows/publish-hotfix-release.yml | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index 1870c9343..e8dd99857 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -39,16 +39,20 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.ref_name, 'hotfix/') steps: - - uses: mukunku/tag-exists-action@v1.6.0 - id: check-tag + - uses: actions/checkout@v4 with: - tag: ${{ inputs.version }} - - - if: steps.check-tag.outputs.exists == 'true' - name: Exit on tag existance - run: | - echo "Tag already exists! Please choose another tag." - exit 1 + fetch-depth: 0 + - id: check-tag + name: Check if tag exists + run: |- + + tag=$(git tag -l ${{ inputs.version }}) + + if [ ! -z $tag ]; + then + echo "Tag already exists! Please choose another tag." + exit 1 + fi release-version: name: Determine release version From 973e915447d75feb6f973c6ad15c236b176d6964 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 12:55:50 +0100 Subject: [PATCH 05/10] Comment --- .github/workflows/publish-hotfix-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index e8dd99857..e27dd3769 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -218,7 +218,7 @@ jobs: git push origin gh-pages - # Release: GitHub tag & release; Merges back releases into main; Starts a new development cycle; + # Release: GitHub tag & release; github-release: name: Publish new github release needs: [ prepare-hotfix-release, release-version, maven-release, docker-release, helm-release ] From 237291eeb9a7674b3e19a203c17d3823c324824a Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 13:01:36 +0100 Subject: [PATCH 06/10] Remove unecessary variable --- .github/workflows/publish-hotfix-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index e27dd3769..dd492ce2f 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -108,7 +108,6 @@ jobs: git add gradle.properties $(find charts -name Chart.yaml) $(find charts -name README.md) git commit --message "Prepare release ${{ needs.release-version.outputs.RELEASE_VERSION }}" - echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT # Release: Maven Artifacts maven-release: From c24084146ae9dad6a139561ae477c8eef49b2764 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 16:59:43 +0100 Subject: [PATCH 07/10] Remove unnecessary Job and its dependencies --- .github/workflows/publish-hotfix-release.yml | 64 ++++++-------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index dd492ce2f..6f83b9cc0 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -54,28 +54,15 @@ jobs: exit 1 fi - release-version: - name: Determine release version - needs: [validate-release] - runs-on: ubuntu-latest - outputs: - RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }} - steps: - - name: Output release version - id: release-version - run: | - echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT - prepare-hotfix-release: name: "Prepare hotfix release" runs-on: ubuntu-latest - needs: [release-version] + needs: [validate-release] permissions: contents: write packages: write pages: write pull-requests: write - if: needs.release-version.outputs.RELEASE_VERSION steps: - uses: actions/checkout@v4 - name: Initialize mandatory git config @@ -86,7 +73,7 @@ jobs: - name: Bump version in gradle.properties run: |- # replace the project's (default) version, could be overwritten later with the -Pversion=... flag - sed -i 's/version=.*/version=${{ needs.release-version.outputs.RELEASE_VERSION }}/g' gradle.properties + sed -i 's/version=.*/version=${{ inputs.version }}/g' gradle.properties env: GITHUB_PACKAGE_USERNAME: ${{ github.actor }} GITHUB_PACKAGE_PASSWORD: ${{ secrets.GITHUB_TOKEN }} @@ -94,7 +81,7 @@ jobs: uses: mikefarah/yq@v4.44.2 with: cmd: |- - find charts -name Chart.yaml -maxdepth 3 | xargs -n1 yq -i '.appVersion = "${{ needs.release-version.outputs.RELEASE_VERSION }}" | .version = "${{ needs.release-version.outputs.RELEASE_VERSION }}"' + find charts -name Chart.yaml -maxdepth 3 | xargs -n1 yq -i '.appVersion = "${{ inputs.version }}" | .version = "${{ inputs.version }}"' - name: Update Chart READMEs uses: addnab/docker-run-action@v3 with: @@ -106,22 +93,18 @@ jobs: id: make-commit run: | git add gradle.properties $(find charts -name Chart.yaml) $(find charts -name README.md) - git commit --message "Prepare release ${{ needs.release-version.outputs.RELEASE_VERSION }}" + git commit --message "Prepare release ${{ inputs.version }}" # Release: Maven Artifacts maven-release: name: Publish extension's release version to maven repository - needs: [ prepare-hotfix-release, release-version ] + needs: [ prepare-hotfix-release, validate-release ] runs-on: ubuntu-latest permissions: contents: read packages: write - if: needs.release-version.outputs.RELEASE_VERSION steps: - - name: Export RELEASE_VERSION env - run: | - echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV # Set-Up - uses: actions/checkout@v4 @@ -139,17 +122,15 @@ jobs: OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} run: |- - echo "Publishing Version $RELEASE_VERSION to Sonatype/MavenCentral" - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Pversion=$RELEASE_VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" + echo "Publishing Version ${{ inputs.version }} to Sonatype/MavenCentral" + ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Pversion=${{inputs.version}} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" docker-release: name: Publish Docker images runs-on: ubuntu-latest - needs: [ prepare-hotfix-release, release-version ] + needs: [ prepare-hotfix-release, validate-release ] permissions: contents: write - if: needs.release-version.outputs.RELEASE_VERSION - strategy: fail-fast: false matrix: @@ -161,13 +142,10 @@ jobs: { dir: edc-tests/runtime, img: mock-connector }] steps: - uses: actions/checkout@v4 - - name: Export RELEASE_VERSION env - run: | - echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV - uses: ./.github/actions/publish-docker-image name: Publish ${{ matrix.variant.img }} with: - docker_tag: ${{ env.RELEASE_VERSION }} + docker_tag: ${{ inputs.version }} rootDir: ${{ matrix.variant.dir }}/${{ matrix.variant.img }} imagename: ${{ matrix.variant.img }} docker_user: ${{ secrets.DOCKER_HUB_USER }} @@ -177,18 +155,14 @@ jobs: # Release: Helm Charts helm-release: name: Publish new helm release - needs: [ prepare-hotfix-release, release-version ] + needs: [ prepare-hotfix-release, validate-release ] runs-on: ubuntu-latest permissions: contents: write packages: write pages: write - if: needs.release-version.outputs.RELEASE_VERSION steps: - - name: Export RELEASE_VERSION env - run: | - echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -213,25 +187,21 @@ jobs: # Commit and push to gh-pages git add index.yaml helm-charts - git commit -s -m "Release ${{ env.RELEASE_VERSION }}" + git commit -s -m "Release ${{ inputs.version }}" git push origin gh-pages # Release: GitHub tag & release; github-release: name: Publish new github release - needs: [ prepare-hotfix-release, release-version, maven-release, docker-release, helm-release ] + needs: [ prepare-hotfix-release, validate-release, maven-release, docker-release, helm-release ] runs-on: ubuntu-latest permissions: contents: write packages: write pages: write pull-requests: write - if: needs.release-version.outputs.RELEASE_VERSION steps: - - name: Export RELEASE_VERSION env - run: | - echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV - uses: actions/checkout@v4 with: # 0 to fetch the full history due to upcoming merge of releases into main branch @@ -248,13 +218,13 @@ jobs: git tag # Create & push tag - git tag --force ${{ env.RELEASE_VERSION }} - git push --force origin ${{ env.RELEASE_VERSION }} + git tag --force ${{ inputs.version }} + git push --force origin ${{ inputs.version }} - name: Create GitHub Release uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: ${{ env.RELEASE_VERSION }} + tag: ${{ inputs.version }} token: ${{ secrets.GITHUB_TOKEN }} makeLatest: false removeArtifacts: true @@ -263,8 +233,8 @@ jobs: name: "Publish OpenAPI spec to Swaggerhub" permissions: contents: read - needs: [ prepare-hotfix-release, release-version ] + needs: [ prepare-hotfix-release, validate-release ] uses: ./.github/workflows/publish-swaggerhub.yaml with: - downstream-version: ${{ needs.release-version.outputs.RELEASE_VERSION }} + downstream-version: ${{ inputs.version }} secrets: inherit From 5adff934e40c5aef29e11e11864957a498992768 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Mon, 26 Aug 2024 17:34:32 +0100 Subject: [PATCH 08/10] checked permissions --- .github/workflows/publish-hotfix-release.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index 6f83b9cc0..92174b6ca 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -60,9 +60,6 @@ jobs: needs: [validate-release] permissions: contents: write - packages: write - pages: write - pull-requests: write steps: - uses: actions/checkout@v4 - name: Initialize mandatory git config @@ -103,7 +100,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - packages: write steps: # Set-Up @@ -198,9 +194,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - packages: write - pages: write - pull-requests: write steps: - uses: actions/checkout@v4 with: From e8b8ff8603ef548ec5fc6dbac3e6e07c7a855f99 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Tue, 27 Aug 2024 10:07:00 +0100 Subject: [PATCH 09/10] Change branch validation from hotfix to bugfix --- .github/workflows/publish-hotfix-release.yml | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-hotfix-release.yml index 92174b6ca..a1e97857f 100644 --- a/.github/workflows/publish-hotfix-release.yml +++ b/.github/workflows/publish-hotfix-release.yml @@ -19,25 +19,25 @@ --- -name: "Publish hotfix release" +name: "Publish bugfix release" # Temporary workflow to enable the release of bugfix versions. # Should be reworked as this file contains duplicate code from draft-new-release and publish-new-release -# This workflow, as is, should be executed after the hotfix branch is created and all needed PRs are merged +# This workflow, as is, should be executed after the bugfix branch is created and all needed PRs are merged on: workflow_dispatch: inputs: version: - description: 'The hotfix version you want to release.' + description: 'The bugfix version you want to release.' required: true jobs: # Gate: Check release version presence validate-release: - name: Validate if hotfix can be released + name: Validate if bugfix version can be released runs-on: ubuntu-latest - if: startsWith(github.ref_name, 'hotfix/') + if: startsWith(github.ref_name, 'bugfix/') steps: - uses: actions/checkout@v4 with: @@ -54,8 +54,8 @@ jobs: exit 1 fi - prepare-hotfix-release: - name: "Prepare hotfix release" + prepare-bugfix-release: + name: "Prepare bugfix release" runs-on: ubuntu-latest needs: [validate-release] permissions: @@ -96,7 +96,7 @@ jobs: # Release: Maven Artifacts maven-release: name: Publish extension's release version to maven repository - needs: [ prepare-hotfix-release, validate-release ] + needs: [ prepare-bugfix-release, validate-release ] runs-on: ubuntu-latest permissions: contents: read @@ -124,7 +124,7 @@ jobs: docker-release: name: Publish Docker images runs-on: ubuntu-latest - needs: [ prepare-hotfix-release, validate-release ] + needs: [ prepare-bugfix-release, validate-release ] permissions: contents: write strategy: @@ -151,7 +151,7 @@ jobs: # Release: Helm Charts helm-release: name: Publish new helm release - needs: [ prepare-hotfix-release, validate-release ] + needs: [ prepare-bugfix-release, validate-release ] runs-on: ubuntu-latest permissions: contents: write @@ -190,7 +190,7 @@ jobs: # Release: GitHub tag & release; github-release: name: Publish new github release - needs: [ prepare-hotfix-release, validate-release, maven-release, docker-release, helm-release ] + needs: [ prepare-bugfix-release, validate-release, maven-release, docker-release, helm-release ] runs-on: ubuntu-latest permissions: contents: write @@ -226,7 +226,7 @@ jobs: name: "Publish OpenAPI spec to Swaggerhub" permissions: contents: read - needs: [ prepare-hotfix-release, validate-release ] + needs: [ prepare-bugfix-release, validate-release ] uses: ./.github/workflows/publish-swaggerhub.yaml with: downstream-version: ${{ inputs.version }} From e307b841b4e2aca15d485f3c2030b3b320bbb991 Mon Sep 17 00:00:00 2001 From: Rafael Magalhaes Date: Tue, 27 Aug 2024 10:07:27 +0100 Subject: [PATCH 10/10] rename file --- .../{publish-hotfix-release.yml => publish-bugfix-release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish-hotfix-release.yml => publish-bugfix-release.yml} (100%) diff --git a/.github/workflows/publish-hotfix-release.yml b/.github/workflows/publish-bugfix-release.yml similarity index 100% rename from .github/workflows/publish-hotfix-release.yml rename to .github/workflows/publish-bugfix-release.yml