-
-
Notifications
You must be signed in to change notification settings - Fork 12
38 lines (31 loc) · 1.15 KB
/
release.yaml
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
---
name: Release
# Lifted shamelessly from https://github.com/custom-components/grocy
on:
release:
types: [published]
permissions: {}
jobs:
release_zip_file:
name: Prepare and upload release asset
runs-on: ubuntu-latest
permissions:
contents: write
env:
BERMUDA_ROOT_DIR: "${{ github.workspace }}/custom_components/bermuda"
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set release version number in files
run: |
sed -i '/VERSION.=./c\VERSION = "${{ github.ref_name }}"' "${{ env.BERMUDA_ROOT_DIR }}/const.py"
(jq '.version = "${{ github.ref_name }}"' "${{ env.BERMUDA_ROOT_DIR }}/manifest.json") > "${{ env.BERMUDA_ROOT_DIR }}/manifest.json.tmp"
mv "${{ env.BERMUDA_ROOT_DIR }}/manifest.json.tmp" "${{ env.BERMUDA_ROOT_DIR }}/manifest.json"
- name: Zip the integration directory
run: |
cd "${{ env.BERMUDA_ROOT_DIR }}"
zip bermuda.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
files: ${{ env.BERMUDA_ROOT_DIR }}/bermuda.zip