Skip to content

Commit 4566f85

Browse files
committed
ci: make publish depend on bump
1 parent 101ebf0 commit 4566f85

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/bump-version.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Bump version
2+
3+
on:
4+
workflow_dispatch: # Allows manual triggering from GitHub UI
5+
6+
jobs:
7+
bump_version:
8+
if: "!startsWith(github.event.head_commit.message, 'bump:')"
9+
runs-on: ubuntu-latest
10+
name: "Bump version and create changelog with commitizen"
11+
steps:
12+
- uses: actions/create-github-app-token@v1
13+
id: app-token
14+
with:
15+
app-id: ${{ vars.ELEMENTSINTERACTIVE_BOT_APP_ID }}
16+
private-key: ${{ secrets.ELEMENTSINTERACTIVE_BOT_PRIVATE_KEY }}
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
token: ${{ steps.app-token.outputs.token }}
21+
ref: ${{ github.head_ref }}
22+
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
23+
persist-credentials: false
24+
- id: cz
25+
name: Create bump and changelog
26+
uses: commitizen-tools/commitizen-action@master
27+
with:
28+
github_token: ${{ steps.app-token.outputs.token }}
29+
- name: Print Version
30+
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"

.github/workflows/publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Publish
22

33
on:
44
push:
5-
branches: ["main"]
5+
tags:
6+
- "v*.*.*"
67

78
permissions:
89
contents: write

0 commit comments

Comments
 (0)