Skip to content

Commit

Permalink
chore: add hacs.json and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyLewin committed Feb 21, 2022
1 parent f2a0802 commit 830c0d1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
release:
types: [published]

jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v1

- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: "Set version number"
run: |
sed -i '/VERSION = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/lifetime_fitness/const.py
sed -i '/version/c\ \"version\": \"${{ steps.get_version.outputs.VERSION }}\"' ${{ github.workspace }}/custom_components/lifetime_fitness/manifest.json
- name: Zip
run: |
cd ${{ github.workspace }}/custom_components/lifetime_fitness
zip lifetime_fitness.zip -r ./
- name: Upload Zip to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/custom_components/lifetime_fitness/lifetime_fitness.zip
asset_name: lifetime_fitness.zip
tag: ${{ github.ref }}
overwrite: true
8 changes: 8 additions & 0 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Life Time Fitness",
"domains": ["sensor"],
"iot_class": "Cloud Polling",
"render_readme": true,
"zip_release": true,
"filename": "lifetime_fitness.zip"
}

0 comments on commit 830c0d1

Please sign in to comment.