Skip to content

Commit f24e7ed

Browse files
committed
first attempt with auto version bump
1 parent a71a979 commit f24e7ed

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update Version on Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update-version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Update manifest version
20+
run: |
21+
VERSION=${GITHUB_REF_NAME#v}
22+
echo "Updating version to $VERSION"
23+
jq --arg v "$VERSION" '.version = $v' custom_components/victron_mqtt/manifest.json > tmp.json
24+
mv tmp.json custom_components/victron_mqtt/manifest.json
25+
26+
- name: Commit and push
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "github-actions[bot]@users.noreply.github.com"
30+
git add custom_components/victron_mqtt/manifest.json
31+
git commit -m "Bump version to ${GITHUB_REF_NAME#v}" || exit 0
32+
git push
33+
34+
- name: Update release tag to include version bump
35+
run: |
36+
git tag -f $GITHUB_REF_NAME
37+
git push -f origin $GITHUB_REF_NAME

0 commit comments

Comments
 (0)