Skip to content

Commit

Permalink
Merge pull request #25 from nodenv/release-npm
Browse files Browse the repository at this point in the history
Release to npm registry
  • Loading branch information
jasonkarns authored May 30, 2024
2 parents cf1d379 + acc15f2 commit 32173de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ on:
default: true
required: false
type: boolean
npm_scope: # FIXME until setup-node infers scope from package.json
description: 'Name of scope to publish package under.'
default: nodenv
required: false
type: string

permissions:
contents: write
permissions: {contents: write}

jobs:
github:
Expand Down Expand Up @@ -39,3 +43,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git push -f origin "HEAD:${GITHUB_REF%%.*}"

npm:
permissions: {id-token: write}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: # FIXME https://github.com/actions/setup-node/pull/129
scope: ${{ inputs.npm_scope }}
registry-url: https://registry.npmjs.org
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ jobs:
- run: npm cit

super-linter:
permissions: {contents: read, packages: read, statuses: write}
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write # to report status checks
steps:
- uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0
with: {fetch-depth: 0}
- uses: super-linter/super-linter/slim@v6
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 32173de

Please sign in to comment.