forked from Teng91/chatbot-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.08 KB
/
Copy pathrelease.yml
File metadata and controls
39 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Bump Version on Tag
on:
push:
tags:
- 'v*'
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.CHATBOT_PLUGIN_RELEASE_PAT }}
- name: Set version from tag
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
- name: Commit version bump
run: |
VERSION=${GITHUB_REF#refs/tags/v}
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pyproject.toml
git commit -m "chore: bump version to $VERSION [skip ci]"
git push origin HEAD:refs/heads/master
- name: Move tag to version bump commit
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
git tag -f "$TAG_NAME"
git push origin "refs/tags/$TAG_NAME" --force