-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.17 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This file is automatically managed by <https://github.com/dtinth/jslibdevkit>.
# Any manual changes to this file may be overwritten.
name: Publish
on:
push:
tags:
- '*'
jobs:
test:
name: Release
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2 # v2.0.1
with:
version: 6.26.0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: pnpm
- name: Install dependencies and build
run: pnpm install --prefer-offline
- name: Get tag for npm publish
id: get-tag
run: |
if [ -f .changeset/pre.json ]; then
TAG=$(jq -r '.tag' .changeset/pre.json)
else
TAG=latest
fi
echo "$TAG"
echo "::set-output name=tag::$TAG"
- name: Publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
tag: ${{ steps.get-tag.outputs.tag }}