2023-02-28 10:43:04 +00:00
|
|
|
name: Build and Release
|
2023-02-28 10:35:20 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# NPM Registry Release
|
|
|
|
release:
|
|
|
|
# Use Ubuntu 22.04
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
# Step I
|
|
|
|
- name: Get Source Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
# Step II
|
2023-02-28 12:15:13 +00:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-02-28 12:17:24 +00:00
|
|
|
node-version: 16
|
2023-02-28 12:15:13 +00:00
|
|
|
# Step III
|
2023-02-28 10:43:04 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm ci
|
2023-02-28 12:15:13 +00:00
|
|
|
# Step IV
|
2023-02-28 10:43:04 +00:00
|
|
|
- name: Build Project
|
|
|
|
run: npm run build
|
2023-02-28 12:15:13 +00:00
|
|
|
# Step V
|
2023-02-28 10:35:20 +00:00
|
|
|
- name: Publish to NPM Registry
|
2023-02-28 10:50:32 +00:00
|
|
|
uses: JS-DevTools/npm-publish@v1
|
2023-02-28 10:55:04 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
2023-02-28 12:15:13 +00:00
|
|
|
# Step VI
|
2023-02-28 11:15:05 +00:00
|
|
|
- name: Generate Changelog
|
|
|
|
run: npx changelogithub@0.12
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|