Skip to content

Commit 746232a

Browse files
authored
Merge pull request #190 from huizebruin/dev
try again
2 parents 42f71c9 + 1c3be9e commit 746232a

File tree

2 files changed

+22
-39
lines changed

2 files changed

+22
-39
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,32 @@ jobs:
1313
id-token: write
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Get variables
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Get version from tag
1720
id: version
18-
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
21+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
1922

20-
- uses: actions/checkout@v4
21-
with:
22-
ref: ${{ steps.version.outputs.version }}
23+
- name: Read version from YAML file
24+
id: read_version
25+
run: |
26+
yaml_version=$(grep 'project_version:' esphome/components/basis.yaml | awk '{print $2}' | tr -d '"')
27+
echo "yaml_version=$yaml_version" >> $GITHUB_ENV
28+
29+
- name: Validate version consistency
30+
id: validate_version
31+
run: |
32+
if [ "${yaml_version}" != "${version}" ]; then
33+
echo "Tag version (${version}) does not match project_version (${yaml_version}) in YAML file."
34+
exit 1
35+
fi
2336
2437
- uses: release-drafter/release-drafter@v6.0.0
2538
with:
26-
tag: ${{ steps.version.outputs.version }}
27-
name: ${{ steps.version.outputs.version }}
28-
version: ${{ steps.version.outputs.version }}
39+
tag: ${{ env.version }}
40+
name: ${{ env.version }}
41+
version: ${{ env.version }}
2942
publish: true
3043
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sitemaps.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)