-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (32 loc) · 1.41 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
name: Release
on:
release:
types: [published]
jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Update versions
run: |
sed -i 's/VERSION = "0.0.0"/VERSION = "${{ steps.get_version.outputs.VERSION }}"/g' ${{ github.workspace }}/custom_components/lock_code_manager/const.py
sed -i 's/"version": "0.0.0"/"version": "${{ steps.get_version.outputs.VERSION }}"/g' ${{ github.workspace }}/custom_components/lock_code_manager/manifest.json
sed -i 's/"version": "0.0.0"/"version": "${{ steps.get_version.outputs.VERSION }}"/g' ${{ github.workspace }}/package.json
# Pack the lock_code_manager dir as a zip and upload to the release
- name: ZIP Keymaster Dir
run: |
cd ${{ github.workspace }}/custom_components/lock_code_manager
zip lock_code_manager.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/custom_components/lock_code_manager/lock_code_manager.zip
asset_name: lock_code_manager.zip
tag: ${{ github.ref }}
overwrite: true