diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml new file mode 100644 index 0000000..b84eb41 --- /dev/null +++ b/.github/workflows/npm_publish.yml @@ -0,0 +1,19 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 4304c8c..a7f8904 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,38 @@ { "version": "0.5.0", - "name": "soroban-governor-js-sdk", - "dependencies": { - "@stellar/freighter-api": "1.7.1", - "buffer": "6.0.3", - "@stellar/stellar-sdk": "11.2.2" - }, + "name": "@script3/soroban-governor-sdk", + "description": "Javascript SDK for the Soroban Governor", + "type": "module", + "license": "MIT", "scripts": { "build": "node ./scripts/build.mjs" }, "exports": { "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js" + "import": "./dist/esm/index.js", + "types": "./dist/types/index.d.ts" }, "typings": "dist/types/index.d.ts", + "files": [ + "/dist" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/script3/soroban-governor-js-sdk.git" + }, + "bugs": { + "url": "https://github.com/script3/soroban-governor-js-sdk/issues" + }, + "homepage": "https://github.com/script3/soroban-governor-js-sdk#readme", + "dependencies": { + "@stellar/freighter-api": "1.7.1", + "buffer": "6.0.3", + "@stellar/stellar-sdk": "11.2.2" + }, "devDependencies": { "typescript": "5.3.3" } -} +} \ No newline at end of file