Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change tag creation #297

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/git-cliff-changelog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body = """
{% set commit_base_url = "https://github.com/juspay/hyperswitch-control-center/commit/" -%}
{% set compare_base_url = "https://github.com/juspay/hyperswitch-control-center/compare/" -%}
{% if version -%}
## {{ version | trim_start_matches(pat="v") }} ({{ timestamp | date(format="%Y-%m-%d") }})
## {{ version }}
{% else -%}
## [unreleased]
{% endif -%}
Expand Down Expand Up @@ -69,7 +69,8 @@ commit_parsers = [
{ message = "^(?i)(refactor)", group = "<!-- 4 -->Refactors" },
{ message = "^(?i)(test)", group = "<!-- 5 -->Testing" },
{ message = "^(?i)(docs)", group = "<!-- 6 -->Documentation" },
{ message = "^(?i)(chore\\(version\\)): V[\\d]+\\.[\\d]+\\.[\\d]+", skip = true },
{ message = "^(?i)(chore\\(version\\)): (V|v)[\\d]+\\.[\\d]+\\.[\\d]+", skip = true },
{ message = "^(?i)(chore\\(version\\)): [0-9]{4}\\.[0-9]{2}\\.[0-9]{2}(\\.[0-9]+)?(-.+)?", skip = true },
{ message = "^(?i)(chore)", group = "<!-- 7 -->Miscellaneous Tasks" },
{ message = "^(?i)(build)", group = "<!-- 8 -->Build System / Dependencies" },
{ message = "^(?i)(ci)", skip = true },
Expand All @@ -79,7 +80,7 @@ protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
tag_pattern = "[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}(\\.[0-9]+)?(-.+)?"
# regex for skipping tags
# skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
Expand Down
59 changes: 5 additions & 54 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,57 +23,8 @@ env:
RUSTUP_MAX_RETRIES: 10

jobs:
create-release:
name: Release a new version
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.AUTO_RELEASE_PAT }}

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 2 weeks ago

- name: Install cocogitto
uses: baptiste0928/[email protected]
with:
crate: cocogitto
version: 5.4.0

- name: Set Git Configuration
shell: bash
run: |
git config --local user.name 'github-actions'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'

- name: Obtain previous and new tag information
shell: bash
# Only consider tags on current branch when setting PREVIOUS_TAG
run: |
PREVIOUS_TAG="$(git tag --sort='version:refname' --merged | tail --lines 1)"
if [[ "$(cog bump --auto --dry-run)" == *"No conventional commits for your repository that required a bump"* ]]; then
NEW_TAG="$(cog bump --patch --dry-run)"
else
NEW_TAG="$(cog bump --auto --dry-run)"
fi
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_ENV

- name: Update changelog and create tag
shell: bash
if: ${{ env.NEW_TAG != env.PREVIOUS_TAG }}
# Remove prefix 'v' from 'NEW_TAG' as cog bump --version expects only the version number
run: |
cog bump --version ${NEW_TAG#v}

- name: Push created commit and tag
shell: bash
if: ${{ env.NEW_TAG != env.PREVIOUS_TAG }}
run: |
git push
git push --tags
create-nightly-tag:
name: Create a nightly tag
uses: juspay/hyperswitch/.github/workflows/release-nightly-version-reusable.yml@main
secrets:
token: ${{ secrets.AUTO_RELEASE_PAT }}
Loading