Skip to content

Commit

Permalink
Use Frencks release actions instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DurgNomis-drol authored Dec 17, 2023
1 parent ff487fb commit c00e83e
Showing 1 changed file with 38 additions and 29 deletions.
67 changes: 38 additions & 29 deletions .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
---
name: "Release"
name: Release

on:
release:
types: ["published"]

env:
PYTHON_VERSION: "3.11"
types:
- published

jobs:
release_zip_file:
name: "Update manifest and upload zip file"
runs-on: "ubuntu-latest"
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "⚙️ Get version"
id: "version"
uses: "home-assistant/actions/helpers/version@master"
- name: "⚙️ Set version number"
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1

- name: 🔢 Adjust version number
shell: bash
run: |
"python script/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/ha_toyota/manifest.json"
- name: 📦 Created zipped release package
shell: bash
run: |
cd custom_components/toyota
zip toyota.zip -r ./
- name: "⬆️ Upload zip to release"
uses: "svenstaro/upload-release-action@v2"
cd "${{ github.workspace }}/custom_components/ha_toyota"
zip ha_toyota.zip -r ./
- name: 🔏 Sign release package
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: ${{ github.workspace }}/custom_components/ha_toyota/ha_toyota.zip

- name: ⬆️ Upload zip to release
uses: softprops/action-gh-release@v0.1.15
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
file: "./custom_components/toyota/toyota.zip"
asset_name: "toyota.zip"
tag: "${{ github.ref }}"
overwrite: true
files: ${{ github.workspace }}/custom_components/ha_toyota/ha_toyota.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 c00e83e

Please sign in to comment.