Skip to content

Commit 231e7cf

Browse files
committed
[Release] Bump version - Return the order
1 parent e847a88 commit 231e7cf

File tree

1 file changed

+25
-32
lines changed

1 file changed

+25
-32
lines changed

.github/workflows/build-or-publish.yml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@ jobs:
7272
with:
7373
fetch-depth: 0
7474

75+
- name: Compute unique CalVer release branch name
76+
id: calver
77+
run: |
78+
base_name=$(date +"%Y%m%d-%H%M%S")
79+
80+
git fetch origin "+refs/heads/release/*:refs/remotes/origin/release/*" || true
81+
82+
rc_index=0
83+
candidate="${base_name}_RC$(printf '%02d' $rc_index)"
84+
while git branch -r | grep -q "origin/release/${candidate}"; do
85+
rc_index=$((rc_index + 1))
86+
candidate="${base_name}_RC$(printf '%02d' $rc_index)"
87+
done
88+
release_branch="release/${candidate}"
89+
echo "release_branch=${release_branch}" >> $GITHUB_OUTPUT
90+
echo "Selected release branch: ${release_branch}"
91+
92+
- name: Create and push release branch from current master commit
93+
env:
94+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
run: |
96+
branch="${{ steps.calver.outputs.release_branch }}"
97+
git checkout -b "$branch"
98+
git push https://x-access-token:${GIT_TOKEN}@github.com/${{ github.repository }} "HEAD:refs/heads/${branch}"
99+
75100
- name: Build and Test
76101
uses: ./.github/action/build
77102

@@ -80,13 +105,6 @@ jobs:
80105
cp README.md dist/README.md
81106
cp LICENSE dist/LICENSE
82107
83-
- name: Setup Node for GitHub Packages (auth)
84-
uses: actions/setup-node@v4
85-
with:
86-
node-version: '20'
87-
registry-url: https://npm.pkg.github.com/celonis
88-
scope: '@celonis'
89-
90108
- name: Publish to GitHub Registry
91109
env:
92110
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -106,31 +124,6 @@ jobs:
106124
cd dist/
107125
npm publish --access public
108126
109-
- name: Compute unique CalVer release branch name
110-
id: calver
111-
run: |
112-
base_name=$(date +"%Y%m%d-%H%M%S")
113-
114-
git fetch origin "+refs/heads/release/*:refs/remotes/origin/release/*" || true
115-
116-
rc_index=0
117-
candidate="${base_name}_RC$(printf '%02d' $rc_index)"
118-
while git branch -r | grep -q "origin/release/${candidate}"; do
119-
rc_index=$((rc_index + 1))
120-
candidate="${base_name}_RC$(printf '%02d' $rc_index)"
121-
done
122-
release_branch="release/${candidate}"
123-
echo "release_branch=${release_branch}" >> $GITHUB_OUTPUT
124-
echo "Selected release branch: ${release_branch}"
125-
126-
- name: Create and push release branch from current master commit
127-
env:
128-
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129-
run: |
130-
branch="${{ steps.calver.outputs.release_branch }}"
131-
git checkout -b "$branch"
132-
git push https://x-access-token:${GIT_TOKEN}@github.com/${{ github.repository }} "HEAD:refs/heads/${branch}"
133-
134127
- name: Tag release version
135128
env:
136129
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)