Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Merge pull request #50 from 0chain/ashu/ci
Browse files Browse the repository at this point in the history
ashuvssut authored May 8, 2024
2 parents 523c400 + 02d9b91 commit af90702
Showing 13 changed files with 4,556 additions and 2,390 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
42 changes: 42 additions & 0 deletions .github/workflows/changeset-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Action checkout
uses: actions/checkout@v4

- name: Setting up Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Installing dependencies
run: cd lib/js-sdk && yarn

- name: tsc Linting
run: cd lib/js-sdk && yarn lint

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: cd lib/js-sdk && yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.npm_token2 }}
NODE_AUTH_TOKEN: ${{secrets.npm_token2}}
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Action checkout
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setting up Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: "yarn"

- name: Check for yarn.lock file
run: |
if [ ! -f "yarn.lock" ]; then
echo "yarn.lock file not found."
exit 1
fi
- name: Check network connectivity
run: ping -c 5 google.com

- name: Increase verbosity for yarn install
run: yarn install --verbose

- name: tsc Linting
run: cd lib/js-sdk && yarn lint

- name: Build SDK dist/
run: cd lib/js-sdk && yarn build
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.1.cjs

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
yarnPath: .yarn/releases/yarn-3.4.1.cjs
checksumBehavior: update

compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.1.cjs
8 changes: 8 additions & 0 deletions lib/js-sdk/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions lib/js-sdk/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions lib/js-sdk/.changeset/wicked-otters-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zerochain/zus-sdk": minor
---

add TS support
5 changes: 4 additions & 1 deletion lib/js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,9 @@
"start": "node src/example.js",
"dev": "tsc -w",
"build": "tsc",
"lint": "tsc"
"lint": "tsc --noEmit",
"release": "yarn build && yarn changeset publish",
"version": "yarn changeset"
},
"main": "dist/index.js",
"module": "dist/index.js",
@@ -33,6 +35,7 @@
"access": "public"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@types/bluebird": "^3.5.42",
"@types/json-bigint": "^1.0.4",
"typescript": "^4.9.4"
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -13,9 +13,11 @@
"dev": "concurrently \"yarn dev:app\" \"yarn dev:lib\"",
"build:app": "cd ./example/webapp && yarn build",
"build:lib": "cd ./lib/js-sdk && yarn build",
"build": "yarn build:app && yarn build:lib"
"build": "yarn build:app && yarn build:lib",
"version": "cd ./lib/js-sdk && yarn version"
},
"devDependencies": {
"concurrently": "^8.2.2"
}
},
"packageManager": "yarn@4.2.1"
}
5,039 changes: 3,526 additions & 1,513 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit af90702

Please sign in to comment.