-
-
Notifications
You must be signed in to change notification settings - Fork 28
41 lines (35 loc) · 1.17 KB
/
release_zip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
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