websri/.github/workflows/release.yml

36 lines
1 KiB
YAML

name: release
run-name: "${{ inputs.version }}"
on:
workflow_dispatch:
inputs:
version:
description: 'Increment "major", "minor", "patch", or "pre*" version; or specify version'
default: patch
required: true
jobs:
main:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm test
- name: Release
run: |
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
npm run release -- "${{ github.event.inputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}