-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (45 loc) · 1.62 KB
/
build-wordpress-plugin.yml
File metadata and controls
56 lines (45 loc) · 1.62 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
name: Build WordPress Plugin
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm install
- name: Set release version
if: github.event_name == 'release'
run: echo "PLUGIN_VERSION=${{ github.event.release.tag_name }}" | sed 's/=v/=/' >> $GITHUB_ENV
- run: npm run build:wordpress-plugin
- name: Find built files
id: find-files
run: |
ZIP_PATH=$(ls dist/oiaa-meetings-wordpress-plugin-*.zip)
echo "zip_path=$ZIP_PATH" >> $GITHUB_OUTPUT
echo "zip_name=$(basename $ZIP_PATH)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.find-files.outputs.zip_name }}
path: ${{ steps.find-files.outputs.zip_path }}
- name: Upload release assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
${{ steps.find-files.outputs.zip_path }}
- name: Purge jsDelivr cache
if: github.event_name == 'release'
uses: egad13/purge-jsdelivr-cache@v1
with:
url: |
https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/oiaa-meetings.js
https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/oiaa-meetings.css
https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/wordpress-overrides.css