-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.22 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (58 loc) · 2.22 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
name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
# Run full CI checks before publishing so a bad tag can never ship a broken build.
ci-gate:
name: CI Gate (lint + tests)
uses: ./.github/workflows/ci.yml
release:
name: Build & Release
runs-on: ubuntu-latest
needs: [ci-gate]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24'
cache: 'npm'
- name: Set up PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: '8.2'
extensions: openssl
tools: composer, wp-cli
coverage: none
- name: Install Node dependencies
run: npm ci
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader
- name: Build release zip
run: make release
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Extract changelog section for this version
id: changelog
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
# Extract the block between "## [x.y.z]" and the next "## [" heading.
# awk prints from the first matching heading (exclusive) until the next heading.
NOTES=$(awk "/^## \[${VERSION}\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md)
# Write to a temp file to avoid quoting nightmares with multiline strings.
printf '%s' "$NOTES" > /tmp/release-notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
name: Dispatch for Telex ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: /tmp/release-notes.md
files: dispatch-for-telex-${{ steps.version.outputs.VERSION }}.zip
fail_on_unmatched_files: true
generate_release_notes: false