-
Notifications
You must be signed in to change notification settings - Fork 4
TA-4043: Release management improvement #269
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
Merged
Zgjim Haziri (ZgjimHaziri)
merged 16 commits into
master
from
TA-4043-release-management
Oct 15, 2025
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
78f0855
TA-4043: Add release management workflows
ZgjimHaziri d1f289f
TA-4043: Change some echo messages
ZgjimHaziri 37b7ac5
TA-4043: Fix CalVer format in release branch names
ZgjimHaziri d7e477f
TA-4043: Provide hotfix actions
ZgjimHaziri 8735465
TA-4043: Rename Build PR workflow for clarity
ZgjimHaziri dfdd8b1
TA-4043: Change release logic
ZgjimHaziri cc54307
TA-4043: Add master/release restriction to create-release workflow
ZgjimHaziri 947eb3a
TA-4043: Make base wherever the workflow was triggered from
ZgjimHaziri f35aaca
TA-4043: Simplify automated branch creation
ZgjimHaziri 27ceaf4
TA-4043: Add release branch tagging
ZgjimHaziri c347594
TA-4043: Add release management guide
ZgjimHaziri 71cf55f
TA-4043: Link local build guide in the "developing a new feature" sec…
ZgjimHaziri e882d79
TA-4043: Remove GIT_CLI_ADMIN_TOKEN usage
ZgjimHaziri 0a4791f
TA-4043: Add restriction for release branch on bump type to only patch
ZgjimHaziri 8d2aa0d
TA-4043: Extract `build` part of the workflow in its own action
ZgjimHaziri e0014c5
TA-4043: Fix used action name
ZgjimHaziri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| name: Build / Publish Workflow | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
| - 'release/*' | ||
| paths-ignore: | ||
| - '.github/**' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| detect-bump: | ||
| name: Detect Version Bump | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| is_bump: ${{ steps.check.outputs.is_bump }} | ||
| commit_sha: ${{ steps.sha.outputs.sha }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 | ||
|
|
||
| - id: sha | ||
| name: Get pushed commit SHA | ||
| run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
|
||
| - id: check | ||
| name: Check if last commit is a version bump | ||
| shell: bash | ||
| run: | | ||
| last_commit_message=$(git log -1 --pretty=%B) | ||
| echo "Last commit message: $last_commit_message" | ||
| if [[ "$last_commit_message" =~ "\[Release\] Bump version" ]]; then | ||
| echo "is_bump=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "is_bump=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Echo outputs | ||
| run: | | ||
| echo "is_bump = ${{ steps.check.outputs.is_bump }}" | ||
|
|
||
| build-only: | ||
| name: Build (no publish) | ||
| runs-on: ubuntu-latest | ||
| needs: detect-bump | ||
| if: needs.detect-bump.outputs.is_bump != 'true' | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| registry-url: https://npm.pkg.github.com/celonis | ||
| scope: '@celonis' | ||
|
|
||
| - name: Install Dependencies | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
|
|
||
| - name: Test | ||
| run: yarn test | ||
|
|
||
| - name: Done | ||
| run: echo "Regular commit detected — build and test completed." | ||
|
|
||
| create-release-branch-and-publish: | ||
| name: Create release branch (CalVer) and Publish | ||
| runs-on: ubuntu-latest | ||
| needs: detect-bump | ||
| if: needs.detect-bump.outputs.is_bump == 'true' && github.ref == 'refs/heads/master' | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Git user | ||
| run: | | ||
| git config user.name "celobot" | ||
| git config user.email "github-celobot@celonis.com" | ||
|
|
||
| - name: Compute unique CalVer release branch name | ||
| id: calver | ||
| shell: bash | ||
| env: | ||
| GIT_TOKEN: ${{ secrets.GIT_CLI_ADMIN_TOKEN }} | ||
| run: | | ||
| base_name=$(date +"%Y%m%d-%H%M%S") | ||
|
|
||
| git fetch origin "+refs/heads/release/*:refs/remotes/origin/release/*" || true | ||
|
|
||
| rc_index=0 | ||
| candidate="${base_name}_RC$(printf '%02d' $rc_index)" | ||
| while git branch -r | grep -q "origin/release/${candidate}"; do | ||
| rc_index=$((rc_index + 1)) | ||
| candidate="${base_name}_RC$(printf '%02d' $rc_index)" | ||
| done | ||
|
|
||
| release_branch="release/${candidate}" | ||
| echo "release_branch=${release_branch}" >> $GITHUB_OUTPUT | ||
| echo "Selected release branch: ${release_branch}" | ||
|
|
||
| - name: Create and push release branch from current master commit | ||
| env: | ||
| GIT_TOKEN: ${{ secrets.GIT_CLI_ADMIN_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| release_branch="${{ steps.calver.outputs.release_branch }}" | ||
| echo "Creating release branch ${release_branch} from current HEAD (master)" | ||
| git checkout -b "${release_branch}" | ||
| git push https://x-access-token:${GIT_TOKEN}@github.com/${{ github.repository }} "refs/heads/${release_branch}:refs/heads/${release_branch}" | ||
|
|
||
| - name: Prepare dist | ||
| run: | | ||
| yarn install --frozen-lockfile | ||
| yarn build | ||
| yarn test | ||
| cp README.md dist/README.md | ||
| cp LICENSE dist/LICENSE | ||
|
|
||
| - name: Publish to GitHub Registry | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| cd dist/ | ||
| npm publish | ||
|
|
||
| - name: Setup Node for NPM Registry | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| registry-url: https://registry.npmjs.org/ | ||
| scope: '@celonis' | ||
|
|
||
| - name: Publish to NPM Registry | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: | | ||
| cd dist/ | ||
| npm publish --access public | ||
|
|
||
| - name: Tag release version | ||
| env: | ||
| GIT_TOKEN: ${{ secrets.GIT_CLI_ADMIN_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| version=$(node -p "require('./package.json').version") | ||
| tag="v${version}" | ||
| git tag "${tag}" | ||
| git push https://x-access-token:${GIT_TOKEN}@github.com/${{ github.repository }} "${tag}" | ||
|
|
||
| - name: Post-publish note | ||
| run: echo "Release branch ${{ steps.calver.outputs.release_branch }} created, published, and tagged with version." | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Build Workflow | ||
| name: Build Pull Request | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.