Skip to content

Commit df46f68

Browse files
authored
Update release.yml
1 parent 3b954fb commit df46f68

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
11
name: Release
22

33
on:
4-
workflow_dispatch:
54
release:
6-
types: [published]
5+
types:
6+
- published
77

8-
env:
9-
COMPONENT_DIR: isitpayday
8+
permissions: {}
109

1110
jobs:
1211
release_zip_file:
1312
name: Prepare release asset
1413
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
1516
steps:
1617
- name: Check out repository
1718
uses: actions/checkout@v4.2.2
18-
with:
19-
token: ${{ secrets.GITHUB_TOKEN }}
19+
2020
- name: Update manifest.json version to ${{ github.event.release.tag_name }}
21+
shell: bash
2122
run: |
22-
python3 ${{ github.workspace }}/.github/scripts/update_hacs_manifest.py --version ${{ github.event.release.tag_name }} --path /custom_components/isitpayday/
23-
- name: Commit manifest update
24-
run: |
25-
git config user.name github-actions
26-
git config user.email github-actions@github.com
27-
git pull
28-
git add ./custom_components/isitpayday/manifest.json
29-
git commit -m "Updated manifest.json"
30-
git push origin HEAD:main
31-
- name: Create zip
23+
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
24+
"${{ github.workspace }}/custom_components/isitpayday/manifest.json"
25+
26+
- name: ZIP the integration directory
27+
shell: bash
3228
run: |
33-
cd custom_components/isitpayday
29+
cd "${{ github.workspace }}/custom_components/isitpayday"
3430
zip isitpayday.zip -r ./
35-
- name: Upload zip to release
36-
uses: svenstaro/upload-release-action@2.11.2
31+
32+
- name: Upload the ZIP file to the release
33+
uses: softprops/action-gh-release@v2.3.2
3734
with:
38-
repo_token: ${{ secrets.GITHUB_TOKEN }}
39-
file: ./custom_components/isitpayday/isitpayday.zip
40-
asset_name: isitpayday.zip
41-
tag: ${{ github.ref }}
42-
overwrite: true
35+
files: ${{ github.workspace }}/custom_components/isitpayday/isitpayday.zip

0 commit comments

Comments
 (0)