-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 900 Bytes
/
Copy pathrelease.yaml
File metadata and controls
37 lines (30 loc) · 900 Bytes
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Validate tag format
run: |
if [[ ! "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.-]+)?$ ]]; then
echo "Invalid tag format: ${GITHUB_REF_NAME}"
echo "Expected format: v1.2.3 or v1.2.3-beta.1"
exit 1
fi
- name: Extract release notes
run: php tools/changelog/extract-release-notes.php "${GITHUB_REF_NAME}" > release-notes.md
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--title "${GITHUB_REF_NAME}" \
--notes-file release-notes.md