Update package version to 0.1.0, rename package, and add npm and GitHub Packages publishing workflows

This commit is contained in:
anonpenguin23 2025-10-22 09:14:29 +03:00
parent 60e67c98bf
commit 03c62882fa
2 changed files with 70 additions and 3 deletions

65
.github/workflows/publish-npm.yml vendored Normal file
View File

@ -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 }}

View File

@ -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"