From c7c83a643e341abe1e1ee3fd5951207a01270dba Mon Sep 17 00:00:00 2001 From: Malcolm Crum Date: Mon, 9 Dec 2024 17:24:35 +1300 Subject: [PATCH 1/3] Try deploying package from Github --- .github/workflows/publish-package.yml | 21 +++++++++++++++++++ index.js | 3 +++ package.json | 29 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/publish-package.yml create mode 100644 index.js create mode 100644 package.json diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..207d51a --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,21 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..6a8d80f --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +import ppeg from "./pPEG.mjs" + +export { ppeg } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..797abdd --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "ppegjs", + "version": "0.1.1", + "description": "A portable Parser Expression Grammar.", + "main": "index.js", + "directories": { + "example": "examples", + "test": "tests" + }, + "scripts": { + "test": "node peg-play.mjs tests" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/pcanz/pPEGjs.git" + }, + "keywords": [ + "ppeg", + "parser", + "expression", + "grammar" + ], + "author": "Peter Cashin", + "license": "MIT", + "bugs": { + "url": "https://github.com/pcanz/pPEGjs/issues" + }, + "homepage": "https://github.com/pcanz/pPEGjs#readme" +} From 7c3e5d043ae7e2649715b7473b7e3e4f3f57c9d5 Mon Sep 17 00:00:00 2001 From: Malcolm Crum Date: Mon, 9 Dec 2024 17:28:03 +1300 Subject: [PATCH 2/3] No need to ci; no dependencies --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 207d51a..a87beb3 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,3 +1,4 @@ +# from https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages name: Publish Package to npmjs on: release: @@ -15,7 +16,6 @@ jobs: with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' - - run: npm ci - run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 67f12b168815ba38dbdc448414698f397d8f9471 Mon Sep 17 00:00:00 2001 From: Malcolm Crum Date: Mon, 9 Dec 2024 20:48:00 +1300 Subject: [PATCH 3/3] Need this for deploy --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 797abdd..f1a3ca9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/pcanz/pPEGjs.git" + "url": "git+https://github.com/crummy/pPEGjs.git" }, "keywords": [ "ppeg",