-
-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (74 loc) · 2.54 KB
/
release.yml
File metadata and controls
84 lines (74 loc) · 2.54 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release Type'
required: true
type: choice
options:
- stable
- beta
- nightly
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Calculate Version
id: version
run: |
NEW_VERSION=$(python .github/scripts/version_manager.py bump --type ${{ inputs.release_type }})
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Create Release Tag
if: inputs.release_type != 'nightly'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git commit -am "chore(release): bump version to ${{ steps.version.outputs.version }}"
git tag v${{ steps.version.outputs.version }}
git push origin v${{ steps.version.outputs.version }}
git push origin main
- name: 📝 Find Previous Tag
id: pre_tag
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
echo "tag=$PREV_TAG" >> $GITHUB_OUTPUT
- name: 📝 Generate Changelog
if: inputs.release_type != 'nightly'
run: |
python .github/scripts/changelog_builder.py \
--from-tag "${{ steps.pre_tag.outputs.tag }}" \
--repo-url "https://github.com/${{ github.repository }}" \
--output "CHANGELOG_BODY.md"
- name: 📦 Zip Component
if: inputs.release_type != 'nightly'
run: |
cd custom_components
zip -r ../db_infoscreen.zip db_infoscreen
cd ..
- name: Create Release Notes
uses: softprops/action-gh-release@v3
if: inputs.release_type != 'nightly'
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
body_path: CHANGELOG_BODY.md
prerelease: ${{ inputs.release_type == 'beta' }}
files: db_infoscreen.zip
- name: Post-Release Dev Bump
if: inputs.release_type != 'nightly'
run: |
NEW_DEV=$(python .github/scripts/version_manager.py bump --type dev)
git commit -am "chore(dev): bump to $NEW_DEV"
git push origin main