Revert "chore: update versions" #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release hstream operator | |
on: | |
push: | |
tags: | |
- "*" | |
branches-ignore: | |
- "main" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/setup-helm@v3 | |
- name: Check chart version | |
if: ${{ github.ref_type == 'tag' }} | |
run: | | |
version=$(helm show chart deploy/charts/hstream-operator | grep version | awk '{print $2}') | |
if [[ "$version" != "$GITHUB_REF_NAME" ]]; then | |
echo "You need to update the version in Chart.yaml." | |
exit 1 | |
fi | |
- name: Check chart appVersion | |
if: ${{ github.ref_type == 'tag' }} | |
run: | | |
appVersion=$(helm show chart deploy/charts/hstream-operator | grep appVersion | awk '{print $2}') | |
if [[ "$appVersion" != "$GITHUB_REF_NAME" ]]; then | |
echo "You need to update the appVersion in Chart.yaml." | |
exit 1 | |
fi | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/metadata-action@v4 | |
id: meta | |
with: | |
images: ${{ github.repository_owner }}/hstream-operator-controller | |
tags: | | |
type=ref,event=tag | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate hstream-operator.yaml | |
id: yaml | |
run: | | |
make kustomize | |
pushd config/manager && kustomize edit set image controller="${{ github.repository_owner }}/hstream-operator-controller:${{ github.ref_name }}" && popd | |
kustomize build config/default > hstream-operator.yaml | |
echo "yaml=hstream-operator.yaml" >> $GITHUB_OUTPUT | |
- name: Draft or not | |
id: draft | |
run: | | |
if grep -q "^\d+\.\d+\.\d+$" "${{ github.ref_name }}"; then | |
echo "draft=false" >> $GITHUB_OUTPUT | |
else | |
echo "draft=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ github.token }} | |
name: HStream Operator ${{ github.ref_name }} | |
generate_release_notes: ${{ steps.draft.outputs.draft == 'false' }} | |
draft: ${{ steps.draft.outputs.draft }} | |
body: | | |
HStream Operator ${{ github.ref_name }} has been released. | |
See [CHANGELOG](https://github.com/hstreamdb/hstream-operator/blob/main/CHANGELOG.md) for more details. | |
files: | | |
${{ steps.yaml.outputs.yaml }} |