-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (28 loc) · 924 Bytes
/
npm-publish.yml
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
name: Release vue3-analog-clock
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Matches tags like v1.2.3
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 12
uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm install
- name: Extract version from tag
id: extract_version
run: echo ##v | cut -d 'v' -f 2 # Extracts version from tag (vX.X.X)
- name: Update package.json version
run: npm version ${{ steps.extract_version.outputs.version }}
- name: Login to npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> .npmrc
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}