-
-
Notifications
You must be signed in to change notification settings - Fork 403
112 lines (100 loc) · 4.17 KB
/
Copy pathcreate-release-notes.yml
File metadata and controls
112 lines (100 loc) · 4.17 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Create Release Notes
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 5.0.2)'
required: true
type: string
default: '5.0.2'
fromDate:
description: 'From date for changelog (ISO format, e.g., 2025-08-19T16:30:00)'
required: true
type: string
default: '2025-08-19T16:30:00'
toDate:
description: 'To date for changelog (ISO format, leave empty for current date)'
required: false
type: string
milestone:
description: 'Milestone version (e.g., 5.1)'
required: true
type: string
default: '5.1'
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Generate changelog
run: |
GRADLE_ARGS="-Pversion=${{ inputs.version }} -Pmilestone=${{ inputs.milestone }} -PfromDate=${{ inputs.fromDate }}"
if [ -n "${{ inputs.toDate }}" ]; then
GRADLE_ARGS="$GRADLE_ARGS -PtoDate=${{ inputs.toDate }}"
fi
cd launch
gradle buildChangelog $GRADLE_ARGS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set artifact base URL
id: artifact_url
run: |
if [[ "${{ inputs.version }}" == *".M"* ]] || [[ "${{ inputs.version }}" == *".RC"* ]]; then
echo "base_url=https://openhab.jfrog.io/openhab/libs-milestone-local" >> $GITHUB_OUTPUT
else
echo "base_url=https://openhab.jfrog.io/artifactory/libs-release-local" >> $GITHUB_OUTPUT
fi
- name: Download openHAB distribution (ZIP)
run: |
curl -fLsS --retry 3 --retry-delay 5 \
-o openhab-${{ inputs.version }}.zip \
"${{ steps.artifact_url.outputs.base_url }}/org/openhab/distro/openhab/${{ inputs.version }}/openhab-${{ inputs.version }}.zip"
- name: Download openHAB distribution (TAR.GZ)
run: |
curl -fLsS --retry 3 --retry-delay 5 \
-o openhab-${{ inputs.version }}.tar.gz \
"${{ steps.artifact_url.outputs.base_url }}/org/openhab/distro/openhab/${{ inputs.version }}/openhab-${{ inputs.version }}.tar.gz"
- name: Download openHAB add-ons (KAR)
run: |
curl -fLsS --retry 3 --retry-delay 5 \
-o openhab-addons-${{ inputs.version }}.kar \
"${{ steps.artifact_url.outputs.base_url }}/org/openhab/distro/openhab-addons/${{ inputs.version }}/openhab-addons-${{ inputs.version }}.kar"
- name: Create GitHub Release and upload assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create or update release with notes from changelog and attach assets
if gh release view "${{ inputs.version }}" >/dev/null 2>&1; then
# Release exists: update notes and upload assets
gh release edit "${{ inputs.version }}" \
--title "openHAB ${{ inputs.version }}" \
--notes-file "launch/build/changelog.md"
else
gh release create "${{ inputs.version }}" \
--title "openHAB ${{ inputs.version }}" \
--notes-file "launch/build/changelog.md"
fi
gh release upload "${{ inputs.version }}" \
"openhab-${{ inputs.version }}.zip" \
"openhab-${{ inputs.version }}.tar.gz" \
"openhab-addons-${{ inputs.version }}.kar" \
--clobber
- name: Update Homebrew Formula version
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ secrets.HOMEBREW_REPO_ACCESS_TOKEN }}
repository: openhab/homebrew-openhab
event-type: update-version
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "version": "${{ inputs.version }}"}'