Skip to content

Commit

Permalink
Merge pull request #23 from CM000n/enhancement/update_release_file
Browse files Browse the repository at this point in the history
Update release workflow
  • Loading branch information
CM000n authored Jan 7, 2024
2 parents 197ae49 + f27616b commit 2b52725
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 59 deletions.
39 changes: 0 additions & 39 deletions .github/scripts/update_manifest.py

This file was deleted.

54 changes: 34 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,46 @@ name: Release

on:
release:
types: [published]
types:
- published

jobs:
release_zip_file:
name: Prepare release asset
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Get version
id: version
uses: home-assistant/actions/helpers/version@master
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]

- name: Set version number
- name: 🔢 Adjust version number
shell: bash
run: |
python3 ${{ github.workspace }}/.github/scripts/update_manifest.py --version ${{ steps.version.outputs.version }}
- name: Create zip
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
yq e -P -o=json \
-i ".version = \"${version}\"" \
"${{ github.workspace }}/custom_components/qss/manifest.json"
- name: 📦 Created zipped release package
shell: bash
run: |
cd custom_components/qss
cd "${{ github.workspace }}/custom_components/qss"
zip qss.zip -r ./
- name: Upload zip to release
uses: svenstaro/[email protected]
- name: 🔏 Sign release package
uses: sigstore/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./custom_components/qss/qss.zip
asset_name: qss.zip
tag: ${{ github.ref }}
overwrite: true
inputs: ${{ github.workspace }}/custom_components/qss/qss.zip

- name: ⬆️ Upload zip to release
uses: softprops/[email protected]
with:
files: ${{ github.workspace }}/custom_components/qss/qss.zip

# Upload this one in the future, currently problematic for HACS
# https://github.com/frenck/spook/issues/286
# ${{ github.workspace }}/custom_components/spook/spook.zip.sigstore

0 comments on commit 2b52725

Please sign in to comment.