-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (42 loc) · 1.45 KB
/
Copy pathversion-update.yml
File metadata and controls
50 lines (42 loc) · 1.45 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
40
41
42
43
44
45
46
47
48
49
50
name: Version Update
on:
push:
branches:
- os-dev
- pre-develop
- main
permissions:
contents: write
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed so rev-parse HEAD works correctly
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Run version update script
run: python .github/scripts/generate_git_id.py # 👈 replace with your actual path
- name: Commit updated setup.cfg
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add setup.cfg
BRANCH=$(git branch --show-current)
git diff --cached --quiet || git commit -m "chore: update version for ${BRANCH} [skip ci]"
git pull origin
git push
- name: Update CHANGELOG.md
run: |
git pull --rebase origin ${GITHUB_REF_NAME}
python .github/scripts/version_control.py
git config user.name "anylog-ci-bot[bot]"
git config user.email "anylog-ci-bot[bot]@users.noreply.github.com"
git add CHANGELOG.md
git diff --cached --quiet || git commit -s -m "chore: update CHANGELOG unreleased [skip ci]"
git push