Skip to content

Commit

Permalink
Improve release job
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jan 10, 2025
1 parent 37269f0 commit 3acbd56
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,35 @@ on:
release:
types: [published]

env:
COMPONENT_NAME: hydro_imgw

jobs:
release:
name: Prepare release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Download repo
uses: actions/checkout@v1
uses: actions/checkout@v4.2.2

- name: Adjust version number
shell: bash
run: |
version="${{ github.event.release.tag_name }}"
yq e -P -o=json \
-i ".version = \"${version}\"" \
"${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/manifest.json"
- name: Zip hydro_imgw dir
- name: Zip ${{ env.COMPONENT_NAME }} dir
run: |
cd /home/runner/work/Home-Assistant-custom-components-Hydro-IMGW/Home-Assistant-custom-components-Hydro-IMGW/custom_components/hydro_imgw
zip hydro_imgw.zip -r ./
cd "${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}"
zip ${{ env.COMPONENT_NAME }}.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
uses: softprops/action-gh-release@v2.1.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/Home-Assistant-custom-components-Hydro-IMGW/Home-Assistant-custom-components-Hydro-IMGW/custom_components/hydro_imgw/hydro_imgw.zip
asset_name: hydro_imgw.zip
tag: ${{ github.ref }}
overwrite: true
files: ${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/${{ env.COMPONENT_NAME }}.zip
2 changes: 1 addition & 1 deletion custom_components/hydro_imgw/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Hydro-IMGW/issues",
"requirements": ["requests"],
"version": "v1.0.7"
"version": "v0.0.0"
}

0 comments on commit 3acbd56

Please sign in to comment.