Skip to content

docs: update README.md with information about adding CRDs to PROJECT … #41

docs: update README.md with information about adding CRDs to PROJECT …

docs: update README.md with information about adding CRDs to PROJECT … #41

Workflow file for this run

# This job is not inteneded to be run manually. Instead it assumes that proper
# release commit is pushed to the repository. It will then create a new release
# on GitHub.
name: release-bot
on:
push:
branches:
- 'main'
jobs:
look_for_release:
outputs:
release_found: ${{ steps.commit_parser.outputs.release_found }}
release_type: ${{ steps.commit_parser.outputs.release_type }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: search for release command in commit message
id: commit_parser
uses: actions/github-script@v7
with:
script: |
const commitMessage = context.payload.head_commit.message
if (commitMessage.includes('chore(release): [bot]')) {
core.setOutput('release_found', 'true')
core.setOutput('release_type', 'release')
} else if (commitMessage.includes('chore(prerelease): [bot]')) {
core.setOutput('release_found', 'true')
core.setOutput('release_type', 'prerelease')
} else {
core.setOutput('release_found', 'false')
}
semver:
needs:
- look_for_release
if: ${{ needs.look_for_release.outputs.release_found == 'true' }}
outputs:
version: ${{ steps.semver_parser.outputs.fullversion }}
major: ${{ steps.semver_parser.outputs.major }}
minor: ${{ steps.semver_parser.outputs.minor }}
patch: ${{ steps.semver_parser.outputs.patch }}
prerelease: ${{ steps.semver_parser.outputs.prerelease }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read version from VERSION file
run: |
VERSION=$(cat VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Parse semver string
id: semver_parser
uses: booxmedialtd/[email protected]
with:
input_string: ${{ env.VERSION }}
version_extractor_regex: '(.*)$'
- name: check if tag already exists
uses: mukunku/[email protected]
id: tag_exists
with:
tag: ${{ steps.commit_parser.outputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: fail if tag already exists
if: ${{ steps.tag_exists.outputs.exists == 'true' }}
run: exit 1
publish-release:
needs:
- look_for_release
- semver
if: ${{ needs.look_for_release.outputs.release_found == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: ncipollo/release-action@v1
with:
body: |
#### Download Kong Gateway Operator ${{ needs.semver.outputs.version }}:
- [Docker Image](https://hub.docker.com/r/${{ vars.DOCKERHUB_IMAGE_NAME }}/tags?name=${{ needs.semver.outputs.version }})
- [Get started](https://github.com/Kong/gateway-operator/blob/main/README.md)
#### Links:
- [Changelog](https://github.com/Kong/gateway-operator/blob/main/CHANGELOG.md#v${{ needs.semver.outputs.major }}${{ needs.semver.outputs.minor }}${{ needs.semver.outputs.patch }}${{ needs.semver.outputs.prerelease }})
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ needs.semver.outputs.version }}
commit: ${{ github.sha }}
prerelease: ${{ needs.look_for_release.outputs.release_type == 'prerelease' }}