Skip to content

Commit

Permalink
build(release): add pre-release workflow to creat version bump PR
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Apr 10, 2024
1 parent 3c39c64 commit 9990bb0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Pre release

on:
workflow_dispatch:
inputs:
release_tag:
description: 'Image tag in the format x.x.x'
required: true
type: string

env:
RELEASE_TAG: ${{ inputs.release_tag }}
PRERELEASE_DOCS_BRANCH: 'dg8d45z'

jobs:
## TODO we can add a condition like github.actor.role == 'Maintainer' to limit trigger to maintainers only
create_pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: checkout_repo
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0 # necessary for CURRENT_TAG tracing
- name: fetch_tags
run: git fetch --tags origin
- name: bump_version
run: |
export CURRENT_TAG=$(git describe --abbrev=0 --tags)
echo ./build/bump_version.sh "${CURRENT_TAG}" "${RELEASE_TAG}"
./build/bump_version.sh "${CURRENT_TAG}" "${RELEASE_TAG}"
- name: commit_changes
run: |
git config --global user.name 'Kasten Production'
git config --global user.email '[email protected]'
git checkout -B "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}"
git add -A
git commit -s -m "pre-release: Update version to ${RELEASE_TAG}"
- name: create_pr
run: |
git push origin "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}"
gh pr create --title "pre-release: Update version to ${RELEASE_TAG}" --body "Update version to ${RELEASE_TAG}" --head "kan-docs-${PRERELEASE_DOCS_BRANCH}-${RELEASE_TAG}" --base master --reviewer tdmanv,pavannd1,viveksinghggits --label kueue
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,6 @@ changelog:
exclude:
- '^docs:'
- '^test:'
- '^pre-release:'
archives:
- allow_different_binary_count: true

0 comments on commit 9990bb0

Please sign in to comment.