on:
  release:
    types: [published]

jobs:
  release-vocab-term:
    runs-on: ubuntu-latest
    name: Releases the Solid Common Vocab package
    steps:
     # Makes the current repository available to the workflow.
    - name: Checkout repo
      uses: actions/checkout@v4
      # Initializes node for the runner
    - name: Node setup
      uses: actions/setup-node@v4
      with:
        node-version-file: ".nvmrc"
        registry-url: 'https://registry.npmjs.org'
        scope: '@inrupt'
        cache: 'npm'
    - name: NPM install, test and publish
      run: |
        npm install
        npm test
    - run: npm publish --access public
      env:
        NODE_AUTH_TOKEN: ${{ secrets.INRUPT_NPM_TOKEN }}
