forked from elementor/wp2static
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (42 loc) · 1.5 KB
/
build-zip.yml
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 release zip
on:
workflow_dispatch
jobs:
build:
name: Build release zip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build plugin # modify this step as needed
run: |
# run script from project root
EXEC_DIR=$(pwd)
TMP_DIR="$EXEC_DIR/plugintmp"
rm -Rf "$TMP_DIR"
mkdir -p "$TMP_DIR"
rm -Rf "$TMP_DIR/wp2static"
mkdir "$TMP_DIR/wp2static"
# clear dev dependencies
rm -Rf "$EXEC_DIR/vendor/*"
# load prod deps and optimize loader
composer install --quiet --no-dev --optimize-autoloader
# cp all required sources to build dir
cp -r "$EXEC_DIR"/src "$TMP_DIR"/wp2static/
cp -r "$EXEC_DIR"/vendor "$TMP_DIR"/wp2static/
cp -r "$EXEC_DIR"/views "$TMP_DIR"/wp2static/
cp -r "$EXEC_DIR"/css "$TMP_DIR"/wp2static/
cp -r "$EXEC_DIR"/js "$TMP_DIR"/wp2static/
cp -r "$EXEC_DIR"/*.php "$TMP_DIR"/wp2static/
cd "$TMP_DIR" || exit
# tidy permissions
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
zip --quiet -r -9 "./wp2static.zip" ./wp2static
shell: bash
- name: Upload the archive as an artifact
id: upload-plugin-artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: plugintmp/wp2static.zip