-
-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (40 loc) · 1.46 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
name: NPM Publish dim-api-types
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# This will only publish if the package.json version has changed
- name: Check version changes
uses: EndBug/version-check@v2 # More info about the arguments on the action page
id: check # This will be the reference for later
with:
file-name: ./dim-api-types/package.json
file-url: https://unpkg.com/@destinyitemmanager/dim-api-types@latest/package.json
static-checking: localIsNew
- name: pnpm setup
if: steps.check.outputs.changed == 'true'
uses: pnpm/action-setup@v4
- name: Setup Node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
- name: Install
if: steps.check.outputs.changed == 'true'
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
if: steps.check.outputs.changed == 'true'
run: pnpm dim-api-types:build
- name: Publish the package to NPM
if: steps.check.outputs.changed == 'true'
run: cd dim-api-types && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM will automatically authenticate with this