-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.86 KB
/
Copy pathframework-sync.yml
File metadata and controls
83 lines (69 loc) · 2.86 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
name: Sync framework version
# Keeps the bundled SLASHED CSS (and the SLASHED_*_CSS_REF constants) tracking
# the latest published framework release. Runs daily and on demand; opens a PR
# when a newer release exists. Nothing is pushed straight to main.
on:
schedule:
- cron: '0 6 * * *' # daily 06:00 UTC
workflow_dispatch:
inputs:
version:
description: 'Framework version to sync to (e.g. 0.5.23 or "latest")'
required: false
default: 'latest'
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Sync to framework release
run: |
VERSION="${{ github.event.inputs.version || 'latest' }}"
if [ "$VERSION" = "latest" ]; then
npm run update-framework
else
npm run update-framework -- --version="$VERSION"
fi
- uses: shivammathur/setup-php@8358ee0e2e8afe63c2fb8253d1d52085811ab1e5 # v2
with:
php-version: '8.2'
coverage: none
- name: Drift checks against the synced framework
run: SLASHED_FRAMEWORK_DIR=.framework npm run check
- name: Rebuild plugin zip
run: npm run build:zip
- name: Detect the synced framework version
id: ref
run: |
REF=$(grep -oE "define\( *'SLASHED_CSS_REF', *'[^']*'" SLASHED-for-WP/slashed.php | grep -oE "v[0-9][^']*")
echo "tag=$REF" >> "$GITHUB_OUTPUT"
- name: Open PR if anything changed
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
with:
commit-message: "chore: sync bundled framework CSS to ${{ steps.ref.outputs.tag }}"
branch: chore/framework-sync
delete-branch: true
title: "chore: sync bundled framework CSS to ${{ steps.ref.outputs.tag }}"
body: |
Automated sync of the bundled SLASHED framework CSS and
`SLASHED_*_CSS_REF` constants to **${{ steps.ref.outputs.tag }}**.
- dist bundles downloaded from the framework's GitHub Release assets
- `data/inventory.json` + `data/classes-hints.json` regenerated
- `npm run verify` passed as part of `update-framework`
Review the diff and merge to ship the update.
add-paths: |
SLASHED-for-WP/dist/
SLASHED-for-WP/data/
SLASHED-for-WP/integrations/bricks/data/
SLASHED-for-WP/slashed.php
SLASHED-for-WP/integrations/bricks/slashed-bricks.php
SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php