This repository was archived by the owner on Jan 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (47 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
56 lines (47 loc) · 2.03 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: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build plugins
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: "https://registry.npmjs.org"
- name: Install pnpm
run: npm i -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build plugins
run: |
mkdir dist
for plugin in $(find . -type f -name manifest.json -exec dirname {} \; | cut -c3-); do
node build.mjs "$plugin"
done
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v3
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was not triggered by the default branch
with:
name: dist
path: dist/*.{zip,json}
- name: Checkout builds
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
uses: actions/checkout@master
with:
ref: "builds"
path: "builds"
- name: Push builds
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
run: |
rm $GITHUB_WORKSPACE/builds/* || true # clean previous builds
cp dist/*.{zip,json} $GITHUB_WORKSPACE/builds
cd $GITHUB_WORKSPACE/builds
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
git push