mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
prNumber:
|
|
description: The number of the PR that is being deployed
|
|
required: true
|
|
version:
|
|
type: choice
|
|
description: The version that cli should be bumped to
|
|
options:
|
|
- major
|
|
- minor
|
|
- patch
|
|
required: true
|
|
|
|
jobs:
|
|
Publish:
|
|
name: Publishing
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
|
with:
|
|
node-version: 17
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install Node.js dependencies
|
|
run: npm i
|
|
|
|
- name: Link Project
|
|
run: npm link
|
|
|
|
- name: Test sern
|
|
run: sern
|
|
|
|
- name: Publish to npm
|
|
run: |
|
|
TAG=$(echo 'pr-${{ github.event.inputs.prNumber }}')
|
|
VERSION=$(echo '${{github.event.inputs.version}}')
|
|
npm version ${VERSION} --preid "${TAG}.$(git rev-parse --verify --short HEAD)" --git-tag-version=false
|
|
npm publish --tag ${TAG}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|