-
Notifications
You must be signed in to change notification settings - Fork 34
37 lines (31 loc) · 1.08 KB
/
Copy pathupdate-version.yml
File metadata and controls
37 lines (31 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
name: Update Version on Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update manifest version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "Updating version to $VERSION"
jq --arg v "$VERSION" '.version = $v' custom_components/victron_mqtt/manifest.json > tmp.json
mv tmp.json custom_components/victron_mqtt/manifest.json
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add custom_components/victron_mqtt/manifest.json
git commit -m "Bump version to ${GITHUB_REF_NAME#v}" || exit 0
git push
- name: Update release tag to include version bump
run: |
git tag -f $GITHUB_REF_NAME
git push -f origin $GITHUB_REF_NAME