-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 2.02 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (51 loc) · 2.02 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
name: Build & Release on Tag
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
# Full history + tags so we can diff against the previous release tag.
fetch-depth: 0
- name: Compute version from tag
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp manifest version and build HACS zip
run: |
python3 scripts/inject_manifest_version.py --version "${{ steps.ver.outputs.version }}"
mkdir -p dist
# HACS extracts the zip directly into custom_components/run_chicken,
# so the integration files must sit at the root of the archive.
(cd custom_components/run_chicken && zip -r "${GITHUB_WORKSPACE}/dist/ha-run-chicken.zip" .)
- name: List artifacts
run: ls -lah dist
- name: Build release notes from commits
run: |
# Previous release tag by version order (robust to non-linear history).
prev="$(git tag --sort=-v:refname | awk -v cur="${GITHUB_REF_NAME}" 'found {print; exit} $0 == cur {found=1}')"
{
echo "## What's Changed"
echo
if [ -n "$prev" ]; then
git log --no-merges --pretty=format:'- %s' "${prev}..${GITHUB_REF_NAME}"
printf '\n\n'
echo "**Full Changelog**: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${prev}...${GITHUB_REF_NAME}"
else
git log --no-merges --pretty=format:'- %s' "${GITHUB_REF_NAME}"
echo
fi
} > release-notes.md
echo "----- release-notes.md -----"
cat release-notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
with:
body_path: release-notes.md
files: dist/ha-run-chicken.zip