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

ci: release without committing to main branch #1434

Merged
merged 4 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ jobs:
fetch-depth: 0 # Fetch tags, which are required to calculate the new version
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Install commitizen"
run: pip install --user -U commitizen
run: |
pip install --user -U commitizen &&
cz version --verbose
- id: tag
name: "Tag release"
name: "Release: Publish new semver Git Tag"
run: |
VERSION=$(cz bump --get-next)
TAG="v${VERSION}"
git tag "${TAG}"
git push origin "${TAG}" --tags
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
NEW_VERSION=$(cz bump --get-next) || exit 1
TAG="v${NEW_VERSION}"
git tag "${TAG}" &&
git push origin "${TAG}" --tags &&
echo "version=${NEW_VERSION}" | tee "$GITHUB_OUTPUT"
release:
needs: bump_version
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The action contains two jobs; one to bump the version number of the DTP packages

DTP uses [Semantic Versioning](https://semver.org/) for published packages. We also enforce [Conventional Commits](https://conventionalcommits.org/) on the `master` branch through the `.github/workflows/commitlint.yml` Github action, which lets us automatically calculate version numbers.

Commitizen is a tool that supports automatically incrementing SemVer version numbers based on git commit history. Our usage of Commitizen is configured in `.cz.toml`, and is used in a Github action to automatically tag the new version in git.
Commitizen is a tool that supports automatically incrementing SemVer version numbers based on git commit history. Our usage of Commitizen is configured in `.cz.toml`, and is used in a Github action to automatically tag the new version in git and publish to maven (per "automated publishing" section of this doc).

### Automated Publishing

Expand Down
Loading