|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | 4 | release: |
6 | | - types: [published] |
| 5 | + types: |
| 6 | + - published |
7 | 7 |
|
8 | | -env: |
9 | | - COMPONENT_DIR: isitpayday |
| 8 | +permissions: {} |
10 | 9 |
|
11 | 10 | jobs: |
12 | 11 | release_zip_file: |
13 | 12 | name: Prepare release asset |
14 | 13 | runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: write |
15 | 16 | steps: |
16 | 17 | - name: Check out repository |
17 | 18 | uses: actions/checkout@v4.2.2 |
18 | | - with: |
19 | | - token: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + |
20 | 20 | - name: Update manifest.json version to ${{ github.event.release.tag_name }} |
| 21 | + shell: bash |
21 | 22 | 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 |
32 | 28 | run: | |
33 | | - cd custom_components/isitpayday |
| 29 | + cd "${{ github.workspace }}/custom_components/isitpayday" |
34 | 30 | 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 |
37 | 34 | 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