websri/.github/workflows/release.yml
2024-11-01 04:32:09 +00:00

36 lines
1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 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 }}