Merge pull request #258 from DestinyItemManager/loadout-share-migrate #131
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |