v0.0.97 #91
Workflow file for this run
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Manually enter tag' | |
release: | |
types: [published] | |
jobs: | |
release_zip_file: | |
name: Prepare release asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Get Version | |
id: get_version | |
if: ${{ github.event_name == 'release' }} | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Set version number | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
sed -i '/VERSION = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/keymaster/const.py | |
sed -i '/version/c\ \"version\": \"${{ steps.get_version.outputs.VERSION }}\"' ${{ github.workspace }}/custom_components/keymaster/manifest.json | |
- name: Set version number | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
sed -i '/VERSION = /c\VERSION = "${{inputs.tags}}"' ${{ github.workspace }}/custom_components/keymaster/const.py | |
sed -i '/version/c\ \"version\": \"${{inputs.tags}}\"' ${{ github.workspace }}/custom_components/keymaster/manifest.json | |
# Pack the keymaster dir as a zip and upload to the release | |
- name: ZIP Keymaster Dir | |
run: | | |
cd ${{ github.workspace }}/custom_components/keymaster | |
zip keymaster.zip -r ./ | |
- name: 📤 Upload zip to release | |
if: ${{ github.event_name == 'release' }} | |
uses: softprops/[email protected] | |
with: | |
files: ${{ github.workspace }}/custom_components/keymaster/keymaster.zip | |
- name: 📤 Upload zip to release | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: softprops/[email protected] | |
with: | |
files: ${{ github.workspace }}/custom_components/keymaster/keymaster.zip | |
tag_name: ${{inputs.tags}} |