forked from ayecue/text-mesh-transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 2.01 KB
/
ci.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
# Primary CI workflow for Eco's web TextMeshPro transformer package
name: Transformer Package CI
# specify when the workflow should be triggered.
# In this case, it runs on every push and pull request to the "main" branch.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
# Build and verify our package through tests
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# This creates a matrix of Node.js versions to test against.
# It will run the job with Node.js 14.x, 16.x, and 18.x.
steps:
- uses: actions/checkout@v3
# Setup up the Node.js environment based on the specified version.
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# The Node.js version is determined by the matrix defined above.
cache: 'npm'
# It caches npm packages for faster builds in the future.
# Instlal required dependencies and run the build script
- run: npm ci
- run: npm run build --if-present
# Run the project's tests
- run: npm test
# Publish our package to Node's npm
publish-npm:
needs: build
runs-on: ubuntu-latest
# It also runs on the latest version of Ubuntu.
steps:
- uses: actions/checkout@v3
# Setup up the Node.js environment based on the specified version.
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
# This sets up Node.js version 16 and specifies the NPM registry URL.
# It's used for publishing the package to npmjs.org.
# Install required dependencies and publish our package to npm
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
# It sets the NODE_AUTH_TOKEN environment variable with a secret value.
# This token is used for authentication when publishing the package.