From 7ecd3eefa8c592418b50a90c7953e1abd1605671 Mon Sep 17 00:00:00 2001 From: nikugogoi Date: Fri, 9 Dec 2022 16:15:39 +0530 Subject: [PATCH] Add github workflow to publish package (#11) --- .github/workflows/publish.yaml | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..51b9c53 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,32 @@ +name: Publish npm package to gitea +on: + release: + types: [published] +jobs: + npm_publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 16.x ] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - name: Run yarn build + run: | + yarn build + - name: Configure git.vdb.to npm registry + run: | + npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/ + - name: Authenticate to git.vdb.to registry + run: | + npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" + - name: npm publish + run: | + npm publish diff --git a/package.json b/package.json index 4a3e3d1..a3f2dc2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "laconic-sdk", + "name": "@cerc-io/laconic-sdk", "version": "0.1.0", "main": "dist/index.js", "types": "dist/index.d.ts",