Skip to content

Release

Release #66

Workflow file for this run

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: [20.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}}