From 49aae2c8df71fab6410ccddc7f7e83cd33e34d25 Mon Sep 17 00:00:00 2001 From: fossedihelm Date: Tue, 10 Dec 2024 06:28:24 +0100 Subject: [PATCH] release: split bundle files for different arches Create separate bundle files and upload them. Also, release action will push both bundles to ssp-operator Signed-off-by: fossedihelm --- .github/workflows/release.yaml | 24 ++++++++++++++++++------ makefile | 26 ++++++++++++++++---------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c638215..297eda33 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,8 +28,8 @@ jobs: common-templates-ci \ /bin/bash -c "cd /common-templates && export REVISION=1 VERSION="${{ steps.get_release.outputs.tag_name }}" && make release" - - name: Upload Release Asset - id: upload-bundle-asset + - name: Upload x86_64 Release Bundle + id: upload-x86_64-bundle-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} @@ -39,15 +39,26 @@ jobs: asset_name: common-templates.yaml asset_content_type: text/plain + - name: Upload s390x Release Bundle + id: upload-s390x-bundle-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./dist/common-templates-s390x.yaml + asset_name: common-templates-s390x.yaml + asset_content_type: text/plain + - name: Install golang uses: actions/setup-go@v2 - name: Update SSP Operator run: | # Define vars - export VERSION="${{ steps.get_release.outputs.tag_name }}" - export SRC_TEMPLATES_FILE=common-templates.yaml - export DST_TEMPLATES_FILE=common-templates-${VERSION}.yaml + export VERSION="${{ steps.get_release.outputs.tag_name }}" + export TEMPLATES_FILE=common-templates-${VERSION}.yaml + export S390X_TEMPLATES_FILE=common-templates-s390x-${VERSION}.yaml # If GITHUB_FORK_USER is changed, a new access token should be set as a repo secret (ACTIONS_TOKEN) export GITHUB_FORK_USER=ksimon1 @@ -72,7 +83,8 @@ jobs: git checkout -b update-common-templates-${VERSION} # Update the new common-templates file - cp ../dist/${SRC_TEMPLATES_FILE} data/common-templates-bundle/${DST_TEMPLATES_FILE} + cp ../dist/${TEMPLATES_FILE} data/common-templates-bundle/${TEMPLATES_FILE} + cp ../dist/${S390X_TEMPLATES_FILE} data/common-templates-bundle/${S390X_TEMPLATES_FILE} sed -i "s/\bVersion\s*=.*/Version = \"${VERSION}\"/g" internal/operands/common-templates/version.go go fmt ./... diff --git a/makefile b/makefile index f29183bc..0f618468 100644 --- a/makefile +++ b/makefile @@ -15,19 +15,25 @@ export REVISION=$(shell ./revision.sh) dist/templates/%.yaml: generate dist/common-templates.yaml: generate - ( \ - echo -n "# Version " ; \ - git describe --always --tags HEAD ; \ - for F in $(ALL_PRESETS) dist/templates/*.yaml; \ - do \ - echo "---" ; \ - echo "# Source: $$F" ; \ - cat $$F ; \ - done ; \ - ) >$@ + echo -n "# Version " > dist/common-templates.yaml; + git describe --always --tags HEAD >> dist/common-templates.yaml; + echo -n "# Version " > dist/common-templates-s390x.yaml; + git describe --always --tags HEAD >> dist/common-templates-s390x.yaml; + for file in $(ALL_PRESETS) dist/templates/*.yaml; do \ + if [[ "$$file" == *"s390x.yaml" ]]; then \ + echo "---" >> dist/common-templates-s390x.yaml; \ + echo "# Source: $$F" >> dist/common-templates-s390x.yaml; \ + cat "$$file" >> dist/common-templates-s390x.yaml; \ + else \ + echo "---" >> dist/common-templates.yaml; \ + echo "# Source: $$F" >> dist/common-templates.yaml; \ + cat "$$file" >> dist/common-templates.yaml; \ + fi; \ + done release: dist/common-templates.yaml cp dist/common-templates.yaml dist/common-templates-$(VERSION).yaml + cp dist/common-templates-s390x.yaml dist/common-templates-s390x-$(VERSION).yaml e2e-tests: TARGET_ARCH=$(TARGET_ARCH) ./automation/test.sh