Skip to content

Commit

Permalink
Merge pull request #657 from kubevirt-bot/cherry-pick-655-to-release-…
Browse files Browse the repository at this point in the history
…v0.32

[release-v0.32] release: split bundle files for different arches
  • Loading branch information
kubevirt-bot authored Dec 10, 2024
2 parents 019e05a + a7906ef commit c48271a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 22 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 ./...
Expand Down
34 changes: 23 additions & 11 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c48271a

Please sign in to comment.