Skip to content

Commit

Permalink
release: split bundle files for different arches
Browse files Browse the repository at this point in the history
Create separate bundle files and upload them.
Also, release action will push both bundles to
ssp-operator

Signed-off-by: fossedihelm <[email protected]>
  • Loading branch information
fossedihelm committed Dec 10, 2024
1 parent 019e05a commit 49aae2c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 ./...
Expand Down
26 changes: 16 additions & 10 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49aae2c

Please sign in to comment.