Skip to content

Commit f1dcdb8

Browse files
CI and docs
getting ready for 0.0.1 publish
1 parent 1c13312 commit f1dcdb8

File tree

4 files changed

+89
-6
lines changed

4 files changed

+89
-6
lines changed

.github/workflows/checks.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
env:
9+
CI: true
10+
11+
jobs:
12+
checks:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
23+
- name: Use cached node_modules
24+
uses: actions/cache@v4
25+
id: yarn-cache
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
32+
- name: Install
33+
run: yarn install --immutable
34+
35+
- name: Lint
36+
run: yarn lint
37+
38+
- name: Build
39+
run: yarn build

.github/workflows/npm-release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: NPM Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
env:
8+
CI: true
9+
10+
jobs:
11+
publish:
12+
name: Build & Publish to NPM
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22.x
22+
23+
- name: Install
24+
run: yarn install --immutable
25+
26+
- name: Set version
27+
run: npm version --no-git-tag-version ${{github.event.release.tag_name}}
28+
29+
- name: Build
30+
run: yarn build
31+
32+
- name: npm pack
33+
run: cd dist && npm pack
34+
35+
- uses: actions/upload-artifact@v3
36+
with:
37+
name: package
38+
path: "create-polkadot-dapp-*.tgz"
39+
40+
- uses: octokit/[email protected]
41+
with:
42+
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
43+
ref: main
44+
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
Create Polkadot DApp in one command:
44

55
```
6-
npx create-polkadot-dapp
6+
npx create-polkadot-dapp@latest
77
```
8-
_FIXME: the package is yet to be published_
9-
108

119
## Templates
1210

1311
* [react-papi-tailwind](./templates/react-papi-tailwind):<br/>
1412
React front-end app with [PAPI](papi.how) [ReactiveDOT](https://reactivedot.dev) + [dotconnect](https://dotconnect.dev/) for chain and wallet interactions.<br/>
1513
[Tailwind CSS](https://tailwindcss.com) + [Tailwind UI](https://tailwindui.com/). <br/>
1614
[Vite](https://vite.dev/) for dev tooling.
17-
* react-solidity
15+
* react-solidity a monorepo for smart contracts for AssetHub and a React, [Tailwind CSS](https://tailwindcss.com) and [ethers](https://docs.ethers.org/v6/)
1816

1917
## Planned templates
2018
* react-tailwind-solidity: a unified setup for developing Solidity smart contracts on Asset Hub

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-polkadot-dapp",
3-
"version": "0.0.1",
3+
"version": "0.0.0-set-from-ci",
44
"author": "Yuri Volkov <[email protected]>",
55
"license": "MIT",
66
"packageManager": "[email protected]",
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"do-pack": "cd dist && yarn pack",
2323
"do-publish": "cd dist && yarn publish",
24-
"build": "tsc && rm -rf dist/templates && cp -r templates dist/templates && cp yarn.lock dist/",
24+
"build": "tsc && rm -rf dist/templates && cp -r templates dist/templates && cp yarn.lock dist/ && cp README.md dist/",
2525
"back-sync": "node dist/src/scripts/backSync.js",
2626
"lint": "npx eslint ./src/ --ext .js,.jsx,.ts,.tsx",
2727
"lint:fix": "npx eslint ./src/ --ext .js,.jsx,.ts,.tsx --fix"

0 commit comments

Comments
 (0)