Skip to content

Commit

Permalink
Merge pull request #1 from polkadot-api/vo-governance-sdk
Browse files Browse the repository at this point in the history
Governance-sdk: bounties and referenda
  • Loading branch information
voliva authored Jan 13, 2025
2 parents 4e187b3 + d099480 commit 93d5e96
Show file tree
Hide file tree
Showing 30 changed files with 2,504 additions and 410 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
merge_group:
workflow_dispatch:

jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
publish:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
value: [sdk-governance, sdk-ink]
steps:
- uses: actions/checkout@v4
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2
with:
diff-search: true
file-name: ./packages/${{ matrix.value }}/package.json
- uses: actions/cache@v3
if: steps.check.outputs.changed == 'true'
with:
path: .turbo
key: ${{ runner.os }}-20.x-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-20.x-turbo-
- uses: pnpm/action-setup@v3
if: steps.check.outputs.changed == 'true'
- name: Setup Node.js 20.x
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Install deps
if: steps.check.outputs.changed == 'true'
run: pnpm install
- name: Build
if: steps.check.outputs.changed == 'true'
run: pnpm build
- name: Publish
if: steps.check.outputs.changed == 'true'
working-directory: packages/${{ matrix.value }}
run: |
pnpm publish --no-git-checks --access=public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"rollup": "^4.25.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"typescript": "^5.6.3",
"typescript": "^5.7.3",
"vitest": "^2.1.4"
}
},
"packageManager": "[email protected]+sha1.c85a4305534f76d461407b59277b954bac97b5c4"
}
4 changes: 2 additions & 2 deletions packages/common-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
},
"license": "MIT",
"peerDependencies": {
"polkadot-api": ">=1.7.4",
"polkadot-api": "^1.8.1",
"rxjs": ">=7.8.1"
},
"devDependencies": {
"polkadot-api": "^1.7.4",
"polkadot-api": "^1.8.1",
"rxjs": "^7.8.1"
}
}
5 changes: 5 additions & 0 deletions packages/sdk-governance/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## Unreleased

Initial release
1 change: 1 addition & 0 deletions packages/sdk-governance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @polkadot-api/ink-sdk
57 changes: 57 additions & 0 deletions packages/sdk-governance/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "@polkadot-api/sdk-governance",
"version": "0.0.1",
"sideEffects": false,
"author": "Victor Oliva (https://github.com/voliva)",
"repository": {
"type": "git",
"url": "git+https://github.com/polkadot-api/papi-sdks.git"
},
"exports": {
".": {
"node": {
"production": {
"import": "./dist/esm/index.mjs",
"require": "./dist/min/index.js",
"default": "./dist/index.js"
},
"import": "./dist/esm/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"module": "./dist/esm/index.mjs",
"import": "./dist/esm/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
"module": "./dist/esm/index.mjs",
"browser": "./dist/esm/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc --noEmit && rollup -c ../../rollup.config.js",
"lint": "prettier --check README.md \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
"format": "prettier --write README.md \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
"prepack": "pnpm run build"
},
"license": "MIT",
"dependencies": {
"@polkadot-api/common-sdk-utils": "workspace:*",
"@react-rxjs/utils": "^0.9.7"
},
"peerDependencies": {
"@noble/hashes": ">=1.6.1",
"polkadot-api": ">=1.8.1",
"rxjs": ">=7.8.0"
},
"devDependencies": {
"@noble/hashes": "^1.6.1",
"polkadot-api": "^1.8.1",
"rxjs": "^7.8.1"
}
}
Loading

0 comments on commit 93d5e96

Please sign in to comment.