Skip to content

Commit

Permalink
Merge branch 'chore/publish-on-npm'
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed Oct 17, 2023
2 parents e44ef92 + f6c35ab commit 0c712c3
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 13 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release ic-websocket-sdk-js

# only run when the tests complete
on:
workflow_run:
workflows: [ic-websocket-sdk-js tests]
types:
- completed
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
# only run if the tests were successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
type: ${{ steps.npm-publish.outputs.type }}
version: ${{ steps.npm-publish.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- run: npm ci
- run: npm run build
- uses: JS-DevTools/npm-publish@v2
id: npm-publish
with:
token: ${{ secrets.NPM_TOKEN }}

tag:
needs: publish
runs-on: ubuntu-latest
if: ${{ needs.publish.outputs.type }}
outputs:
version: ${{ steps.tag_version.outputs.new_tag }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: v${{ needs.publish.outputs.version }}

release:
needs: tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.tag.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "npm"
cache-dependency-path: "package-lock.json"
- name: Install dependencies
Expand Down
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**

!lib/**
!package.json
!README.md
30 changes: 23 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"name": "ic-websocket-js",
"version": "0.1.0",
"description": "IC WebSocket on the IC",
"description": "IC WebSocket on the Internet Computer",
"repository": {
"type": "git",
"url": "https://github.com/omnia-network/ic-websocket-sdk-js"
},
"bugs": {
"url": "https://github.com/omnia-network/ic-websocket-sdk-js/issues"
},
"keywords": [
"Internet Computer",
"Rust",
"JavaScript",
"Canister"
"Canister",
"WebSocket"
],
"main": "./lib/cjs/index",
"module": "./lib/esm/index",
"scripts": {
"build": "tsc -b && tsc -p tsconfig-cjs.json",
"postinstall": "npm run build",
"test": "LOG_LEVEL=debug jest"
},
"devDependencies": {
Expand Down Expand Up @@ -50,10 +57,12 @@
"last 2 edge version"
],
"dependencies": {
"loglevel": "^1.8.1"
},
"peerDependencies": {
"@dfinity/agent": "^0.19.2",
"@dfinity/candid": "^0.19.2",
"@dfinity/identity-secp256k1": "^0.19.2",
"@dfinity/principal": "^0.19.2",
"loglevel": "^1.8.1"
"@dfinity/principal": "^0.19.2"
}
}

0 comments on commit 0c712c3

Please sign in to comment.