-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (42 loc) · 1.42 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
45
46
47
48
49
50
51
52
53
54
name: nitro-cors/publish
on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
steps:
- name: Checkout 🛎
uses: actions/checkout@master
# Setup .npmrc file to publish to GitHub Packages
- name: Setup node env 🏗 and .npmrc file to publish to GitHub Packages
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
registry-url: 'https://npm.pkg.github.com'
- name: Cache node_modules 📦
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install pnpm globally
run: npm install -g [email protected]
- name: Install project dependencies 👨🏻💻
run: pnpm install
- name: Build the package ready for publishing
run: pnpm run build
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
check-version: true
- if: steps.publish.outputs.type != 'none'
run: |
echo "nitro-cors package version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"