preprocess release name for release workflow (#7486)

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/7493/head
garyschulte 3 months ago committed by GitHub
parent 0dffe63c13
commit c24dea8474
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 33
      .github/workflows/release.yml

@ -19,6 +19,17 @@ jobs:
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Pre-process Release Name
id: pre_process_release_name
run: |
RELEASE_NAME="${{ github.event.release.name }}"
# strip all whitespace
RELEASE_NAME="${RELEASE_NAME//[[:space:]]/}"
if [[ ! "$RELEASE_NAME" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?(-.*)?$ ]]; then
echo "Release name does not conform to a valid besu release format YY.M.v[-suffix], e.g. 24.8.0-RC1."
exit 1
fi
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV # Store in environment variable
- name: Set up Java - name: Set up Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with: with:
@ -30,7 +41,7 @@ jobs:
cache-disabled: true cache-disabled: true
- name: assemble release - name: assemble release
run: run:
./gradlew -Prelease.releaseVersion=${{github.event.release.name}} -Pversion=${{github.event.release.name}} assemble ./gradlew -Prelease.releaseVersion=${{env.RELEASE_NAME}} -Pversion=${{env.RELEASE_NAME}} assemble
- name: hashes - name: hashes
id: hashes id: hashes
run: | run: |
@ -43,13 +54,13 @@ jobs:
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with: with:
path: 'build/distributions/besu*.tar.gz' path: 'build/distributions/besu*.tar.gz'
name: besu-${{ github.event.release.name }}.tar.gz name: besu-${{ env.RELEASE_NAME }}.tar.gz
compression-level: 0 compression-level: 0
- name: upload zipfile - name: upload zipfile
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with: with:
path: 'build/distributions/besu*.zip' path: 'build/distributions/besu*.zip'
name: besu-${{ github.event.release.name }}.zip name: besu-${{ env.RELEASE_NAME }}.zip
compression-level: 0 compression-level: 0
testWindows: testWindows:
@ -121,7 +132,7 @@ jobs:
env: env:
ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }} ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }}
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }} ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }}
run: ./gradlew -Prelease.releaseVersion=${{ github.event.release.name }} -Pversion=${{github.event.release.name}} artifactoryPublish run: ./gradlew -Prelease.releaseVersion=${{ env.RELEASE_NAME }} -Pversion=${{env.RELEASE_NAME}} artifactoryPublish
hadolint: hadolint:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@ -195,11 +206,11 @@ jobs:
architecture: ${{ steps.prep.outputs.ARCH }} architecture: ${{ steps.prep.outputs.ARCH }}
with: with:
cache-disabled: true cache-disabled: true
arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{github.event.release.name}} -Prelease.releaseVersion=${{ github.event.release.name }} arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{env.RELEASE_NAME}} -Prelease.releaseVersion=${{ env.RELEASE_NAME }}
- name: publish - name: publish
env: env:
architecture: ${{ steps.prep.outputs.ARCH }} architecture: ${{ steps.prep.outputs.ARCH }}
run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{github.event.release.name}} -Prelease.releaseVersion=${{ github.event.release.name }} run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{env.RELEASE_NAME}} -Prelease.releaseVersion=${{ env.RELEASE_NAME }}
multiArch: multiArch:
needs: buildDocker needs: buildDocker
@ -226,7 +237,7 @@ jobs:
username: ${{ secrets.DOCKER_USER_RW }} username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PASSWORD_RW }} password: ${{ secrets.DOCKER_PASSWORD_RW }}
- name: multi-arch docker - name: multi-arch docker
run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{github.event.release.name}} -Prelease.releaseVersion=${{ github.event.release.name }} run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{env.RELEASE_NAME}} -Prelease.releaseVersion=${{ env.RELEASE_NAME }}
amendNotes: amendNotes:
needs: multiArch needs: multiArch
@ -239,7 +250,7 @@ jobs:
with: with:
append_body: true append_body: true
body: | body: |
`docker pull ${{env.registry}}/${{secrets.DOCKER_ORG}}/besu:${{github.event.release.name}}` `docker pull ${{env.registry}}/${{secrets.DOCKER_ORG}}/besu:${{env.RELEASE_NAME}}`
dockerPromoteX64: dockerPromoteX64:
needs: multiArch needs: multiArch
@ -262,9 +273,9 @@ jobs:
with: with:
cache-disabled: true cache-disabled: true
- name: Docker upload - name: Docker upload
run: ./gradlew "-Prelease.releaseVersion=${{ github.event.release.name }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" dockerUploadRelease run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_NAME }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" dockerUploadRelease
- name: Docker manifest - name: Docker manifest
run: ./gradlew "-Prelease.releaseVersion=${{ github.event.release.name }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" manifestDockerRelease run: ./gradlew "-Prelease.releaseVersion=${{ env.RELEASE_NAME }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" manifestDockerRelease
verifyContainer: verifyContainer:
needs: dockerPromoteX64 needs: dockerPromoteX64
@ -276,6 +287,6 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Trigger container verify - name: Trigger container verify
run: echo '{"version":"${{ github.event.release.name }}","verify-latest-version":"true"}' | gh workflow run container-verify.yml --json run: echo '{"version":"${{ env.RELEASE_NAME }}","verify-latest-version":"true"}' | gh workflow run container-verify.yml --json
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}

Loading…
Cancel
Save