-
Notifications
You must be signed in to change notification settings - Fork 937
72 lines (67 loc) · 2.4 KB
/
build.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
name: Build AR.js libraries
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch.
# The action script will build all the libs and will commit the files. When a new git tag is created
# will be made a new release.
on: push
jobs:
check-and-test:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set output
id: vars
run: echo name=tag::${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
- name: Check output
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
echo $RELEASE_VERSION
echo ${{ steps.vars.outputs.tag }}
- run: npm update
- run: npm install
- uses: actions/upload-artifact@v4
with:
name: build
path: |
aframe/build/*.js
three.js/build/*.js
- run: |
npm run build
- name: Commit changes
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: new build files from action
add: '["aframe/build", "three.js/build"]'
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
aframe/build/aframe-ar.js
aframe/build/aframe-ar-nft.js
aframe/build/aframe-ar-location-only.js
three.js/build/ar.js
three.js/build/ar.module.js
three.js/build/ar-threex.js
three.js/build/ar-threex.module.js
three.js/build/ar-threex-location-only.js
three.js/build/ar-threex-location-only.module.js