forked from polkadot-api/polkadot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (105 loc) · 3.04 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
branches:
- main
jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-20.x-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-20.x-turbo-
- 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 core
run: pnpm turbo build-core --cache-dir=.turbo
- name: Install papi
run: pnpm install
- name: Build external
run: pnpm build-external
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Run Integration Tests
run: pnpm test:ci
publish:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
value:
[
cli,
client,
codegen,
known-chains,
json-rpc/json-rpc-provider,
json-rpc/json-rpc-provider-proxy,
json-rpc/logs-provider,
json-rpc/polkadot-sdk-compat,
json-rpc/sm-provider,
json-rpc/ws-provider,
merkleize-metadata,
metadata-builders,
metadata-compatibility,
signers/pjs-signer,
signers/polkadot-signer,
signers/signer,
smoldot,
substrate-bindings,
substrate-client,
utils,
view-builder,
observable-client,
]
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 turbo build-core --cache-dir=.turbo
- 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 }}