Merge pull request #422 from turcotmii/main #5
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 zip" | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
release: | |
name: "Publish new release" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout the repository" | |
uses: "actions/[email protected]" | |
- working-directory: ./custom_components | |
run: | | |
echo "package=$(ls -F | grep \/$ | sed -n "s/\///g;1p")" >> $GITHUB_ENV | |
echo "release_version=$(git describe --tags | sed s/v//)" >> $GITHUB_ENV | |
- working-directory: ./custom_components | |
run: | | |
echo "basedir=$(pwd)/${{ env.package }}" >> $GITHUB_ENV | |
- name: "Setup Git" | |
if: env.release_version != '' && success() | |
run: | | |
git config --global user.name "release" | |
git config --global user.email "release@GitHub" | |
- name: "Zip component dir" | |
if: env.release_version != '' && success() | |
working-directory: ./custom_components/${{ env.package }} | |
run: | | |
zip ${{ env.package }}.zip -r ./ | |
- name: "Release" | |
if: env.release_version != '' && success() | |
uses: softprops/[email protected] | |
with: | |
files: ${{ env.basedir }}/${{ env.package }}.zip |