From 03c62882fa40ab2bcb0528e4e503921e3b41ea47 Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Wed, 22 Oct 2025 09:14:29 +0300 Subject: [PATCH] Update package version to 0.1.0, rename package, and add npm and GitHub Packages publishing workflows --- .github/workflows/publish-npm.yml | 65 +++++++++++++++++++++++++++++++ package.json | 8 ++-- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..e2a0265 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,65 @@ +name: Publish SDK to npm + +on: + push: + tags: + - 'v*' # Trigger on version tags (e.g., v0.1.0, v0.2.1) + +jobs: + publish-npm: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + working-directory: network-ts-sdk + + - name: Build SDK + run: pnpm build + working-directory: network-ts-sdk + + - name: Publish to npm + run: npm publish --access public + working-directory: network-ts-sdk + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-github: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js for GitHub Packages + uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://npm.pkg.github.com' + scope: '@network' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + working-directory: network-ts-sdk + + - name: Build SDK + run: pnpm build + working-directory: network-ts-sdk + + - name: Publish to GitHub Packages + run: npm publish + working-directory: network-ts-sdk + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 6304803..917fb20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@network/network-ts-sdk", - "version": "0.0.2", + "name": "network-ts-sdk", + "version": "0.1.0", "description": "TypeScript SDK for DeBros Network Gateway", "type": "module", "main": "./dist/index.js", @@ -27,7 +27,9 @@ "typecheck": "tsc --noEmit", "lint": "eslint src tests", "test": "vitest", - "test:e2e": "vitest run tests/e2e" + "test:e2e": "vitest run tests/e2e", + "release:npm": "npm publish --access public --registry=https://registry.npmjs.org/", + "release:gh": "npm publish --registry=https://npm.pkg.github.com" }, "dependencies": { "isomorphic-ws": "^5.0.0"