Skip to content

Commit

Permalink
Fixing GitHub Action publish
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdametto committed Mar 13, 2024
1 parent 1c0bfcb commit b4c32f3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
name: Publish to NPM

on:
push:
branches: master
on: push

jobs:
publish:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Check out code
uses: actions/checkout@v3

- name: Setup .npmrc file to publish to npm registry
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Check if version has been updated
id: check
Expand All @@ -33,6 +34,6 @@ jobs:

- name: Publish to npm
if: steps.check.outputs.changed == 'true'
run: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ To publish a new version of the `crate-gc-admin` you need to
2. Update `package.json` with the new version
3. Update `CHANGES.md` with a new release section
4. Commit, push, get approval, merge
5. Wait for the GitHub Action to automatically publish the new version on NPM.
5. `git checkout master && git pull`
6. `./devtools/create_tag.sh`
7. Wait for the GitHub Action to automatically publish the new version on NPM registry.
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"name": "@crate.io/crate-gc-admin",
"version": "0.6.18",
"version": "0.6.19",
"author": "crate.io",
"private": false,
"type": "module",
"main": "dist/index.umd.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/crate/crate-gc-admin"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"exports": {
".": {
"import": "./dist/index.es.js",
Expand Down

0 comments on commit b4c32f3

Please sign in to comment.