-
Notifications
You must be signed in to change notification settings - Fork 25
86 lines (74 loc) · 2.61 KB
/
release.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
77
78
79
80
81
82
83
84
85
86
name: Release
# trigger a release:
# minor:
# npm version minor -m "Release %s" && git push --tags
# patch:
# npm version patch -m "Release %s" && git push --tags
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to any matching semantic tag. For example, 1.10.1 or 2.0.0.
# For more details, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# and https://docs.npmjs.com/about-semantic-versioning
jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
# build library
- name: npm ci and npm run build
run: |
npm ci
npm run build:prod
- name: lint
run: npm run lint
- name: unit tests
run: npm run test-headless
# set the library package version to the release tag version
- name: Check package version
uses: technote-space/package-version-check-action@v1
with:
COMMIT_DISABLED: 1
PACKAGE_DIR: 'dist/ngx-three'
# build demo
- name: build demo
run: npm run build:demo
- name: copy index.html to 404.html
run: cp dist/ngx-three-demo/index.html dist/ngx-three-demo/404.html
# deploy demo to gh-pages
- name: deploy demo to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist/ngx-three-demo
# create a github release
- name: create release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
name: Release ${{ github.ref }}
draft: false
prerelease: false
# publish to npm
- name: publish to npm
run: |
npm run copy:docs
cd ./dist/ngx-three && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}