-
-
Notifications
You must be signed in to change notification settings - Fork 43
52 lines (48 loc) · 1.52 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Publish Node.js Package
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
build-and-publish:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Chackout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
node-version: 16
- uses: pnpm/[email protected]
with:
version: 8.5.1
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: Build project
run: pnpm build
- name: Test project
run: pnpm test
- name: Create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}