From fff570939f93e9194c8eea771a64991fbf29f4f8 Mon Sep 17 00:00:00 2001 From: jeremy cotineau Date: Thu, 31 Oct 2024 10:52:06 +0100 Subject: [PATCH 1/2] NO-JIRA yet repackaging --- .cirrus/tasks.yml | 7 ++++--- {10/community => community-build}/Dockerfile | 0 {10/community => community-build}/entrypoint.sh | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename {10/community => community-build}/Dockerfile (100%) rename {10/community => community-build}/entrypoint.sh (100%) diff --git a/.cirrus/tasks.yml b/.cirrus/tasks.yml index c25ccf97..1f2489d5 100644 --- a/.cirrus/tasks.yml +++ b/.cirrus/tasks.yml @@ -18,6 +18,7 @@ env: CURRENT_LTA_VERSION: 9.9.7 CURRENT_VERSION: 10.7.0 NEXT_VERSION: 10.8.0 + COMMUNITY_BUILD_VERSION: 0000 build_server_hw_template: &BUILD_SERVER_HW_TEMPLATE @@ -93,8 +94,8 @@ multi_arch_build_task: tag: $CURRENT_LTA_VERSION-datacenter-app - version: 9/datacenter/search tag: $CURRENT_LTA_VERSION-datacenter-search - - version: 10/community - tag: $NEXT_VERSION-community + - version: community-build + tag: $COMMUNITY_BUILD_VERSION-community - version: 10/developer tag: $NEXT_VERSION-developer - version: 10/enterprise @@ -193,7 +194,7 @@ multi_arch_test_task: - test_name: docker-compose tag: $CURRENT_LTA_VERSION-datacenter - test_name: docker - tag: $NEXT_VERSION-community + tag: $COMMUNITY_BUILD_VERSION-community - test_name: docker tag: $NEXT_VERSION-developer - test_name: docker diff --git a/10/community/Dockerfile b/community-build/Dockerfile similarity index 100% rename from 10/community/Dockerfile rename to community-build/Dockerfile diff --git a/10/community/entrypoint.sh b/community-build/entrypoint.sh similarity index 100% rename from 10/community/entrypoint.sh rename to community-build/entrypoint.sh From 5f5f988d938516099d08c12aba6ae4f39173cdc8 Mon Sep 17 00:00:00 2001 From: jeremy cotineau Date: Thu, 31 Oct 2024 16:14:42 +0100 Subject: [PATCH 2/2] NO-JIRA repackaging workflow --- .github/workflows/release-template.yml | 33 +++++++++++++++++++ .github/workflows/release.yml | 44 ++++++++++---------------- 2 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/release-template.yml diff --git a/.github/workflows/release-template.yml b/.github/workflows/release-template.yml new file mode 100644 index 00000000..fd6b2064 --- /dev/null +++ b/.github/workflows/release-template.yml @@ -0,0 +1,33 @@ +name: Reusable release job template + +on: + workflow_call: + inputs: + tag: + required: true + type: string + +jobs: + release: + name: Upload Release Asset + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - id: secrets + uses: SonarSource/vault-action-wrapper@3.0.0 + with: + secrets: | + development/kv/data/sign key | gpg_key; + development/kv/data/sign passphrase | gpg_passphrase; + - name: Generate CycloneDX SBOM + uses: SonarSource/gh-action_sbom@v1 + with: + image: "sonarqube:${{ inputs.tag }}" + filename: "sonarqube-${{ inputs.tag }}-bom.json" + upload-artifact: true + upload-release-assets: true + env: + GPG_PRIVATE_KEY_PASSPHRASE: ${{ fromJSON(steps.secrets.outputs.vault).gpg_passphrase }} + GPG_PRIVATE_KEY_BASE64: ${{ fromJSON(steps.secrets.outputs.vault).gpg_key }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88632c29..ab3b319f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,40 +6,28 @@ on: - created jobs: - release: + release-10: name: Upload Release Asset + if: contains(github.event.release.name, '10') strategy: fail-fast: false matrix: tag: - - 9-community - - 9-developer - - 9-enterprise - - 9-datacenter-app - - 9-datacenter-search - - 10-community - 10-developer - 10-enterprise - 10-datacenter-app - 10-datacenter-search - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - steps: - - id: secrets - uses: SonarSource/vault-action-wrapper@3.0.0 - with: - secrets: | - development/kv/data/sign key | gpg_key; - development/kv/data/sign passphrase | gpg_passphrase; - - name: Generate CycloneDX SBOM - uses: SonarSource/gh-action_sbom@v1 - with: - image: "sonarqube:${{ matrix.tag }}" - filename: "sonarqube-${{ matrix.tag }}-bom.json" - upload-artifact: true - upload-release-assets: true - env: - GPG_PRIVATE_KEY_PASSPHRASE: ${{ fromJSON(steps.secrets.outputs.vault).gpg_passphrase }} - GPG_PRIVATE_KEY_BASE64: ${{ fromJSON(steps.secrets.outputs.vault).gpg_key }} + uses: ./.github/workflows/release-template.yml + with: + tag: ${{ matrix.tag }} + release-community: + name: Upload Release Asset + if: contains(github.event.release.name, 'community') + strategy: + fail-fast: false + matrix: + tag: + - community + uses: ./.github/workflows/release-template.yml + with: + tag: ${{ matrix.tag }} \ No newline at end of file