-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
64 lines (53 loc) · 1.88 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
55
56
57
58
59
60
61
62
63
name: Publish
on:
release:
types:
- published
push:
branches:
- main
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: true
jobs:
release_zip_file:
name: Publish HACS zip file asset
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4.1.7
- name: 🛠️ Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.12"
- name: 🔢 Get version
if: ${{ github.event_name == 'release' }}
id: version
uses: home-assistant/actions/helpers/version@master
- name: 🔢 Set version number
if: ${{ github.event_name == 'release' }}
run: |
sed -i "/MINIMUM_HA_VERSION = /c\MINIMUM_HA_VERSION = \"$(jq .homeassistant -r ${{ github.workspace }}/hacs.json)\"" ${{ github.workspace }}/custom_components/hacs/const.py
python3 ${{ github.workspace }}/scripts/update/manifest.py --version ${{ steps.version.outputs.version }}
- name: ⏬ Download HACS frontend
run: ${{ github.workspace }}/scripts/install/frontend
- name: 📤 Upload zip to action
uses: actions/upload-artifact@v4.3.4
if: ${{ github.event_name == 'push' }}
with:
name: hacs
path: ${{ github.workspace }}/custom_components/hacs
retention-days: 7
# Pack the HACS dir as a zip and upload to the release
- name: 📦 ZIP HACS Dir
if: ${{ github.event_name == 'release' }}
run: |
cd ${{ github.workspace }}/custom_components/hacs
zip hacs.zip -r ./
- name: 📤 Upload zip to release
uses: softprops/action-gh-release@v2.0.8
if: ${{ github.event_name == 'release' }}
with:
files: ${{ github.workspace }}/custom_components/hacs/hacs.zip