Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release workflow #23

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading