-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (46 loc) · 1.48 KB
/
publish.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
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Publish
on:
release:
types:
- published
push:
branches:
- main
- master
jobs:
release_zip_file:
name: Publish zip file asset
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
- name: 🛠️ Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: 🔢 Get version
id: version
uses: home-assistant/actions/helpers/version@master
- name: 🔢 Set version number
run: |
python3 ${{ github.workspace }}/scripts/update_manifest.py --version ${{ steps.version.outputs.version }}
bash ${{ github.workspace }}/scripts/update_const ${{ steps.version.outputs.version }}
- name: 📤 Upload zip to action
uses: actions/[email protected]
if: ${{ github.event_name == 'push' }}
with:
name: heru
path: ${{ github.workspace }}/custom_components/heru
# Pack the dir as a zip and upload to the release
- name: 📦 ZIP Dir
if: ${{ github.event_name == 'release' }}
run: |
cd ${{ github.workspace }}/custom_components/heru
zip heru.zip -r ./
- name: 📤 Upload zip to release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'release' }}
with:
files: ${{ github.workspace }}/custom_components/heru/heru.zip