-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff487fb
commit c00e83e
Showing
1 changed file
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |