Skip to content

Commit 1846255

Browse files
author
Chris Gårdenberg
committed
chore: First checkin to see if it builds on GH Actions.
0 parents  commit 1846255

13 files changed

Lines changed: 3382 additions & 0 deletions

.github/workflows/ci-builds.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run CI to see if it works
2+
on:
3+
push:
4+
branches: master
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
fetch-depth: 1
13+
submodules: false
14+
lfs: false
15+
- name: Get Node 18.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 18.x
19+
- name: Build source files
20+
shell: bash
21+
run: |
22+
yarn
23+
yarn gulp deploy
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy new production version (production)
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 1
13+
submodules: false
14+
lfs: false
15+
- name: Get Node 18.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 18.x
19+
- name: Build source files
20+
shell: bash
21+
run: |
22+
yarn
23+
yarn gulp deploy
24+
- name: Deploy trunk to SVN
25+
env:
26+
WP_USERNAME: ${{ secrets.WP_USERNAME }}
27+
WP_PASSWORD: ${{ secrets.WP_PASSWORD }}
28+
SLACK_HOOKURL: ${{ secrets.SLACK_HOOKURL }}
29+
run: |
30+
$GITHUB_WORKSPACE/scripts/github-deploy.sh

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
node_modules/

Gulpfile.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const gulp = require("gulp");
2+
const replace = require("gulp-replace");
3+
const pinfo = require("./package.json");
4+
5+
/* Debug */
6+
7+
gulp.task("readme-version", function () {
8+
return gulp
9+
.src("src/README.md")
10+
.pipe(replace("$PLUGINVERSION$", pinfo.version))
11+
.pipe(replace("$PLUGINATLEAST$", pinfo.config.eduadmin.requiresAtLeast))
12+
.pipe(replace("$PLUGINTESTEDTO$", pinfo.config.eduadmin.testedUpTo))
13+
.pipe(
14+
replace(
15+
"$PLUGINREQUIREDPHP$",
16+
pinfo.config.eduadmin.minimumPhpVersion
17+
)
18+
)
19+
.pipe(gulp.dest("./"));
20+
});
21+
22+
gulp.task("plugin-version", function () {
23+
return gulp
24+
.src("src/eduadmin-google.php")
25+
.pipe(replace("$PLUGINVERSION$", pinfo.version))
26+
.pipe(replace("$PLUGINATLEAST$", pinfo.config.eduadmin.requiresAtLeast))
27+
.pipe(replace("$PLUGINTESTEDTO$", pinfo.config.eduadmin.testedUpTo))
28+
.pipe(gulp.dest("./"));
29+
});
30+
31+
32+
/* Deploy */
33+
34+
35+
gulp.task("default", function () {
36+
gulp.watch("src/eduadmin-google.php", gulp.series("plugin-version"));
37+
gulp.watch("src/README.md", gulp.series("readme-version"));
38+
gulp.watch(
39+
"package.json",
40+
gulp.series("readme-version", "plugin-version")
41+
);
42+
});
43+
44+
gulp.task(
45+
"debug",
46+
gulp.series(
47+
"readme-version",
48+
"plugin-version"
49+
)
50+
);
51+
52+
gulp.task(
53+
"deploy",
54+
gulp.series(
55+
"readme-version",
56+
"plugin-version"
57+
)
58+
);

0 commit comments

Comments
 (0)