diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c638215..2cae20c8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,16 +28,16 @@ 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 + - name: Upload Release Bundles id: upload-bundle-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./dist/common-templates.yaml - asset_name: common-templates.yaml - asset_content_type: text/plain + generate_release_notes: true + fail_on_unmatched_files: true + files: | + ./dist/common-templates-${{ steps.get_release.outputs.tag_name }}.yaml + ./dist/common-templates-amd64-${{ steps.get_release.outputs.tag_name }}.yaml + ./dist/common-templates-s390x-${{ steps.get_release.outputs.tag_name }}.yaml - name: Install golang uses: actions/setup-go@v2 @@ -46,8 +46,9 @@ jobs: 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 TEMPLATES_FILE=common-templates-${VERSION}.yaml + export AMD64_TEMPLATES_FILE=common-templates-amd64-${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 +73,9 @@ 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/${AMD64_TEMPLATES_FILE} data/common-templates-bundle/${AMD64_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..83705163 100644 --- a/makefile +++ b/makefile @@ -14,20 +14,32 @@ 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 ; \ - ) >$@ +dist/common-templates.yaml: + echo -n "# Version " > dist/common-templates.yaml; + git describe --always --tags HEAD >> dist/common-templates.yaml; + echo -n "# Version " > dist/common-templates-amd64.yaml; + git describe --always --tags HEAD >> dist/common-templates-amd64.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: $$file" >> dist/common-templates-s390x.yaml; \ + cat "$$file" >> dist/common-templates-s390x.yaml; \ + else \ + echo "---" >> dist/common-templates-amd64.yaml; \ + echo "# Source: $$file" >> dist/common-templates-amd64.yaml; \ + cat "$$file" >> dist/common-templates-amd64.yaml; \ + fi; \ + echo "---" >> dist/common-templates.yaml; \ + echo "# Source: $$file" >> dist/common-templates.yaml; \ + cat "$$file" >> dist/common-templates.yaml; \ + done release: dist/common-templates.yaml cp dist/common-templates.yaml dist/common-templates-$(VERSION).yaml + cp dist/common-templates-amd64.yaml dist/common-templates-amd64-$(VERSION).yaml + cp dist/common-templates-s390x.yaml dist/common-templates-s390x-$(VERSION).yaml e2e-tests: TARGET_ARCH=$(TARGET_ARCH) ./automation/test.sh