Skip to content

Commit 8757a96

Browse files
authored
Merge pull request #93 from bjuppa/fix/npm-publish
Improve npm publishing Closes #88
2 parents 1e8a709 + eda20ad commit 8757a96

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ jobs:
1111
- name: Checkout code
1212
uses: actions/checkout@v3
1313

14-
- name: Get tag version
15-
if: startsWith(github.ref, 'refs/tags/')
16-
id: get_tag_version
17-
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
18-
1914
- name: Setup Deno
2015
uses: denoland/setup-deno@v2
2116
with:
2217
deno-version: v2.x # Run with latest stable Deno.
2318

19+
- name: Get tag version
20+
if: startsWith(github.ref, 'refs/tags/')
21+
id: get_tag_version
22+
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
23+
2424
- name: Setup Node
2525
uses: actions/setup-node@v3
2626
with:
27-
node-version: 22
27+
node-version: "22.x"
2828
registry-url: "https://registry.npmjs.org"
2929

30-
- name: Build package
30+
- name: npm build
3131
run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
3232

33-
- name: Publish package
33+
- name: npm publish
3434
if: startsWith(github.ref, 'refs/tags/')
3535
env:
3636
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

DEVELOPMENT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ package using a local path:
4444
```sh
4545
npm install path/to/com-plain-date/npm
4646
```
47+
48+
## Troubleshooting
49+
50+
If publishing to npm gives 404 errors, check that `NPM_TOKEN` is not expired at
51+
<https://www.npmjs.com/settings/bjuppa/tokens> and set properly at
52+
<https://github.com/bjuppa/com-plain-date/settings/secrets/actions>.

0 commit comments

Comments
 (0)