-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release Custom Component to HACS | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Retrieve new version to tag and publish release with | ||
- name: Retrieve version from tag name | ||
id: version | ||
run: | | ||
tag=${{ github.event.release.tag_name }} | ||
version_number=${tag#?} | ||
echo version: $version_number | ||
echo "version=$version_number" >> $GITHUB_OUTPUT | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Update manifest.json version to release version | ||
uses: jossef/action-set-json-field@v2 | ||
with: | ||
file: custom_components/sagemcom_fast/manifest.json | ||
field: version | ||
value: ${{ steps.version.outputs.version }} | ||
|
||
- name: Commit changes | ||
run: | | ||
git add custom_components/sagemcom_fast/manifest.json | ||
git commit -m "Bump version to ${{ steps.version.outputs.version }}." | ||
git tag -f -a ${{ github.event.release.tag_name }} -m "Release ${{ steps.version.outputs.version }}." | ||
git push origin HEAD:main | ||
git push origin -f ${{ github.event.release.tag_name }} |