homebridge-securitysystem 10.0.0-beta.4 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,10 +59,75 @@ jobs:
|
|
|
59
59
|
generateReleaseNotes: true
|
|
60
60
|
allowUpdates: true
|
|
61
61
|
|
|
62
|
+
update-changelog:
|
|
63
|
+
name: Update changelog
|
|
64
|
+
needs: [create-tag, create-release]
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
if: needs.create-tag.outputs.tag-name != ''
|
|
67
|
+
permissions:
|
|
68
|
+
contents: write
|
|
69
|
+
steps:
|
|
70
|
+
- name: Checkout branch
|
|
71
|
+
uses: actions/checkout@v6
|
|
72
|
+
with:
|
|
73
|
+
ref: main
|
|
74
|
+
|
|
75
|
+
- name: Build changelog entry from auto release notes
|
|
76
|
+
env:
|
|
77
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
78
|
+
TAG_NAME: ${{ needs.create-tag.outputs.tag-name }}
|
|
79
|
+
run: |
|
|
80
|
+
release_notes_text="$(
|
|
81
|
+
gh api \
|
|
82
|
+
repos/${{ github.repository }}/releases/tags/${TAG_NAME} \
|
|
83
|
+
--jq '.body'
|
|
84
|
+
)"
|
|
85
|
+
|
|
86
|
+
if [ -z "${release_notes_text}" ]; then
|
|
87
|
+
echo "Release notes were not generated. Skipping changelog update."
|
|
88
|
+
exit 0
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
current_date="$(date -u +%F)"
|
|
92
|
+
release_header="## ${TAG_NAME} - ${current_date}"
|
|
93
|
+
|
|
94
|
+
if [ -f CHANGELOG.md ] && grep -Fqx "${release_header}" CHANGELOG.md; then
|
|
95
|
+
echo "Changelog already contains ${release_header}. Skipping changelog update."
|
|
96
|
+
exit 0
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
temporary_file_path="$(mktemp)"
|
|
100
|
+
{
|
|
101
|
+
echo "# Changelog"
|
|
102
|
+
echo
|
|
103
|
+
echo "${release_header}"
|
|
104
|
+
echo
|
|
105
|
+
echo "${release_notes_text}"
|
|
106
|
+
echo
|
|
107
|
+
if [ -f CHANGELOG.md ]; then
|
|
108
|
+
awk 'NR == 1 && $0 == "# Changelog" { next } { print }' CHANGELOG.md
|
|
109
|
+
fi
|
|
110
|
+
} > "${temporary_file_path}"
|
|
111
|
+
|
|
112
|
+
mv "${temporary_file_path}" CHANGELOG.md
|
|
113
|
+
|
|
114
|
+
- name: Commit changelog
|
|
115
|
+
run: |
|
|
116
|
+
if git diff --quiet CHANGELOG.md; then
|
|
117
|
+
echo "No changelog updates to commit."
|
|
118
|
+
exit 0
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
git config user.name "github-actions[bot]"
|
|
122
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
123
|
+
git add CHANGELOG.md
|
|
124
|
+
git commit -m "docs: update changelog for ${{ needs.create-tag.outputs.tag-name }}"
|
|
125
|
+
git push origin HEAD:main
|
|
126
|
+
|
|
62
127
|
publish-package:
|
|
63
128
|
name: Publish package
|
|
64
129
|
runs-on: ubuntu-latest
|
|
65
|
-
needs: [create-tag, create-release]
|
|
130
|
+
needs: [create-tag, create-release, update-changelog]
|
|
66
131
|
|
|
67
132
|
steps:
|
|
68
133
|
- name: Checkout branch
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "homebridge-securitysystem",
|
|
3
3
|
"displayName": "Homebridge Security System",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "10.0.0
|
|
5
|
+
"version": "10.0.0",
|
|
6
6
|
"description": "Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.",
|
|
7
7
|
"author": "MiguelRipoll23",
|
|
8
8
|
"license": "MIT",
|