-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathexperimental-inventory-cli-publish.yml
More file actions
43 lines (36 loc) · 1.22 KB
/
experimental-inventory-cli-publish.yml
File metadata and controls
43 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: experimental-inventory-cli - Publish to NPM
on:
workflow_dispatch:
inputs:
version:
description: 'release version without v prefix'
required: true
type: string
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: check version matches input
run: |
grep "\"version\": \"${{ github.event.inputs.version }}\"," package.json
working-directory: ./experimental/li-cli
- run: npm ci
working-directory: ./experimental/li-cli
- run: npm run build
working-directory: ./experimental/li-cli
- run: npm publish --access=public
working-directory: ./experimental/li-cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}