-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (119 loc) · 3.64 KB
/
ci-main.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: CI
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
env:
CARGO_TERM_COLOR: always
jobs:
release-please:
name: Update release PRs
runs-on: ubuntu-22.04
environment: main
steps:
- uses: actions/checkout@v3
with:
path: substrate
- name: Clone `release-please`
uses: actions/checkout@v3
with:
repository: rohanku/release-please
path: release-please
ref: dev
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: release-please/package-lock.json
- name: Install `release-please`
working-directory: release-please
run: npm ci
- name: Run release-please
working-directory: substrate
run: |
for command in release-pr github-release; do
node ../release-please/build/src/bin/release-please.js --debug "${command}" \
--token ${{ secrets.SUBSTRATE2_CI_TOKEN_MAIN }} \
--repo-url ${{ github.repository }}
done
check-workspace:
uses: ./.github/workflows/check-workspace.yml
publish-crates:
name: Publish crates
runs-on: ubuntu-22.04
environment: main
needs: [ release-please, check-workspace ]
steps:
- uses: actions/checkout@v3
with:
path: substrate
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
id: toolchain
with:
toolchain: stable
- name: Clone `cargo-workspaces`
uses: actions/checkout@v3
with:
repository: rohanku/cargo-workspaces
path: cargo-workspaces
ref: dev
- name: Cache workspace
uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.toolchain.outputs.cachekey }}
workspaces: |
./substrate -> target
./cargo-workspaces/cargo-workspaces -> target
- name: Build `cargo-workspaces`
working-directory: cargo-workspaces/cargo-workspaces
run: cargo build
- uses: extractions/setup-just@v1
- name: Publish crates
working-directory: substrate
run: ../cargo-workspaces/cargo-workspaces/target/debug/cargo-ws workspaces publish --from-git --token=${{ secrets.KTRA_TOKEN }} --registry=substrate --yes --allow-dirty
coverage:
name: Report coverage
uses: ./.github/workflows/coverage.yml
deploy-api-docs:
name: Deploy API documentation
runs-on: bwrc
environment: main
needs: [ check-workspace ]
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: just build
working-directory: docs/api
- run: flyctl deploy --remote-only --detach
working-directory: docs/api
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_API }}
deploy-docs:
name: Deploy documentation
runs-on: ubuntu-22.04
environment: main
needs: [ check-workspace ]
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: docs/site/yarn.lock
- run: yarn install
working-directory: docs/site
- run: yarn build
working-directory: docs/site
- run: flyctl deploy --remote-only --detach
working-directory: docs/site
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_DOCS }}