forked from h5p/h5p-three-image
-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (68 loc) · 2.31 KB
/
build_and_test.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Node.js CI
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: h5p-escape-room
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.X"
- run: |
cd h5p-escape-room
npm ci
npm run build
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "14"
- run: |
mkdir -p dist
cd dist
while read -r repo; do git clone ${repo}; done < ../h5p-escape-room/build_info/repos
if [ -d "h5p-editor-audio-recorder" ]; then pushd h5p-editor-audio-recorder && npm ci && npm run build; popd; fi
if [ -d "h5p-editor-escape-room" ]; then pushd h5p-editor-escape-room && npm ci && npm run build; popd; fi
cp -r ../h5p-escape-room .
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
- run: |
cd dist
ls
npm install -g h5p
h5p pack -r h5p-escape-room h5p-escape-room.h5p
h5p validate h5p-escape-room.h5p
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: h5p-escape-room.h5p
path: dist/h5p-escape-room.h5p
- name: Load library.json
id: set_library
run: |
ls
JSON=$(cat ./h5p-escape-room/library.json)
JSON="${JSON//'%'/%25}"
JSON="${JSON//$'\n'/%0A}"
JSON="${JSON//$'\r'/%0D}"
echo "::set-output name=library::${JSON}"
- uses: "marvinpinto/action-automatic-releases@latest" # https://github.com/marvinpinto/actions/tree/master/packages/automatic-releases
if: ${{ github.ref == 'refs/heads/master' }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: |
${{
format(
'v{0}.{1}.{2}',
fromJson(steps.set_library.outputs.library).majorVersion,
fromJson(steps.set_library.outputs.library).minorVersion,
fromJson(steps.set_library.outputs.library).patchVersion
)
}}
prerelease: false
files: |
dist/h5p-escape-room.h5p