From 590d721c5d2ed3a16e1f7095157d57223f8196d0 Mon Sep 17 00:00:00 2001 From: Jenny Date: Mon, 8 Feb 2021 19:04:35 +0000 Subject: [PATCH] add zip release and version numbering to manifest (#29) * add zip release and version numbering to manifest * add pinkywafer as codeowner --- .github/workflows/release.yml | 34 +++++++++++++++++++++++++ custom_components/youtube/manifest.json | 3 ++- hacs.json | 6 +++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 hacs.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f0c50a3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + release: + types: [published] + +jobs: + release: + name: Prepare release + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: "Set version number" + run: | + sed -i 's|"version": "0.0.0"|"version": "${{ github.ref }}"|' custom_components/youtube/manifest.json + sed -i 's|refs/heads/||' custom_components/youtube/manifest.json + sed -i 's|refs/tags/||' custom_components/youtube/manifest.json + + - name: ZIP youtube folder + run: | + cd ${{ github.workspace }}/custom_components/youtube + zip youtube.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/youtube/youtube.zip + asset_name: youtube.zip + tag: ${{ github.ref }} + overwrite: true diff --git a/custom_components/youtube/manifest.json b/custom_components/youtube/manifest.json index 3d1192e..bc8f049 100644 --- a/custom_components/youtube/manifest.json +++ b/custom_components/youtube/manifest.json @@ -1,8 +1,9 @@ { "domain": "youtube", "name": "Youtube Sensor", + "version": "0.0.0", "documentation": "https://github.com/custom-components/youtube", "dependencies": [], - "codeowners": ["@ludeeus"], + "codeowners": ["@ludeeus", "@pinkywafer"], "requirements": [] } \ No newline at end of file diff --git a/hacs.json b/hacs.json new file mode 100644 index 0000000..5ff1bc1 --- /dev/null +++ b/hacs.json @@ -0,0 +1,6 @@ +{ + "name": "youtube", + "zip_release": true, + "filename": "youtube.zip", + "iot_class": "Cloud Poll" +}