Release a new version #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release a new version | |
on: | |
workflow_dispatch: | |
inputs: | |
version-bump: | |
description: 'Version Bump' | |
required: true | |
default: 'minor' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Install | |
run: | | |
npm ci | |
- name: Configure git | |
run: | | |
# Configure git | |
git config user.name "$(git log -n 1 --pretty=format:%an)" | |
git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
- name: Bump version | |
id: version | |
run: | | |
npm version ${{ github.event.inputs.version-bump }} | |
echo "::set-output name=new-version::$(npm pkg get version)" | |
- name: Build | |
env: | |
NODE_ENV: production | |
run: | | |
npm run build | |
- name: Push | |
run: | | |
git push --follow-tags origin master | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4.5.0 | |
with: | |
branch: gh-pages | |
folder: dist | |
clean-exclude: | | |
p0weruser.dev.user.js |