-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.41 KB
/
release-build.yaml
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
on:
release:
types: [created]
name: Upload Release Assets
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Node for theme
uses: actions/setup-node@v2
with:
node-version: '20.11'
cache: 'npm'
cache-dependency-path: './theme'
- working-directory: './theme'
run: npm ci && npm run build:css
- name: Build Theme
run: |
mkdir -p ./temp/wpcloud-station
cd ./theme
zip -r ../temp/wpcloud-station/theme.zip . [email protected]
cd ../temp/wpcloud-station
unzip theme.zip
rm theme.zip
cd ..
zip -r ../theme.zip ./wpcloud-station
cd ..
rm -rf temp
- name: Setup Node for plugin
uses: actions/setup-node@v2
with:
node-version: '20.11'
cache: 'npm'
cache-dependency-path: './plugin'
- working-directory: './plugin'
run: npm ci && npm run build
- name: Build plugin
run: |
mkdir -p ./temp/wpcloud-station
cd ./plugin
zip -r ../temp/wpcloud-station/plugin.zip . [email protected]
cd ../temp/wpcloud-station
unzip plugin.zip
rm plugin.zip
cd ..
zip -r ../plugin.zip wpcloud-station
cd ..
rm -rf temp
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Plugin Artifact
id: upload-plugin-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_release.outputs.upload_url }}
asset_path: ./plugin.zip
asset_name: wpcloud-station-plugin.zip
asset_content_type: application/zip
- name: Upload Theme Artifact
id: upload-theme-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_release.outputs.upload_url }}
asset_path: ./theme.zip
asset_name: wpcloud-station-theme.zip
asset_content_type: application/zip