-
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.1 KB
/
release.yml
File metadata and controls
34 lines (32 loc) · 1.1 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
name: Stamp version
on:
release:
types: [published]
jobs:
stamp:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Update manifest.json
run: |
sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.version }}"/' \
custom_components/remote_buttons/manifest.json
- name: Update pyproject.toml
run: |
sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.version }}"/' \
pyproject.toml
- 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/remote_buttons/manifest.json pyproject.toml
git diff --cached --quiet && exit 0
git commit -m "Bump version to ${{ steps.version.outputs.version }} [skip ci]"
git push