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