x-markdown-css/.github/workflows/release.yml

59 lines
1.3 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
# NPM Registry & GitHub 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
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.com
# Step III
- name: Install Dependencies
run: npm ci
# Step IV
- name: Build Project
run: npm run build
# Step V
- name: Create tar.gz File
uses: TheDoctor0/zip-release@latest
with:
type: tar
path: dist/
filename: build.tar.gz
# Step VI
- name: Publish to NPM Registry
uses: rxfork/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
# Step VII
- name: Generate Changelog
run: npx changelogithub@0.12
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step VIII
- name: GitHub Release
uses: marvinpinto/action-automatic-releases@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: |
dist/*
build.tar.gz
# Authored by @kuohuanhuan.