Skip to content

EVEREST-107-wip-pipelines-update #211

EVEREST-107-wip-pipelines-update

EVEREST-107-wip-pipelines-update #211

Workflow file for this run

---
name: Release
on:
push:
branches:
- EVEREST-107-automated-release-fix
permissions:
contents: write
packages: write
checks: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
env:
TOOLS_PATH: "/opt/tools/bin"
VERSION: 1.0.2
RELEASE_TYPE: patch
# version in format "X.Y" which is going to be updated with each patch release
FLOATING_TAG: ''
# branch name in format "release-X.Y"
BRANCH_NAME: ''
# GitHub tag name to use for the RC/Release
GH_TAG: ''
# Shows if this workflow is triggered for RC or Release
IS_RC: 0
ARCH: ''
OS: ''
steps:
- name: Validate input
run: |
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[1-9][0-9]*)?$ ]]; then
echo "Wrong version format provided, please use "X.Y.Z-rcN" format for an RC or "X.Y.Z" format for a release"
exit 1
fi
- name: Set environment variables
run: |
floating_tag=${VERSION%.*}
echo "FLOATING_TAG=$floating_tag" >> $GITHUB_ENV
echo "BRANCH_NAME=release-$floating_tag" >> $GITHUB_ENV
echo "GH_TAG=v$VERSION" >> $GITHUB_ENV
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "IS_RC=1" >> $GITHUB_ENV
fi
echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV
echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV
- name: Catalog - checkout
uses: actions/checkout@v4
with:
repository: percona/everest-catalog
path: everest-catalog
token: ${{ secrets.ROBOT_TOKEN }}
- name: Catalog - update veneer file
run: |
cd everest-catalog/tools
cp ../veneer/everest-operator.yaml ../veneer/everest-operator-original.yaml
echo "---- start -----"
if [[ $IS_RC == 1 ]]; then
echo "---- is RC -----"
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel fast-v0 \
--new-version ${{ env.VERSION }}
else
echo "---- not RC -----"
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel stable-v0 \
--new-version ${{ env.VERSION }}
echo "---------"
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel fast-v0 \
--new-version ${{ env.VERSION }}
fi
echo "---- end -----"
rm -f ../veneer/everest-operator-original.yaml
# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/latest/download/${OS}-${ARCH}-opm
# chmod +x /tmp/opm
# /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml
#