-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (125 loc) · 4.68 KB
/
sync-default-configs.yml
File metadata and controls
144 lines (125 loc) · 4.68 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Sync default seid configs
# Rebuilds the latest tagged seid release, runs `seid init`, and pipes the
# resulting app.toml / config.toml / client.toml into the inlined "Default
# Configurations" section of node/node-operators.mdx. If anything changed,
# opens a PR.
#
# Triggers:
# - workflow_dispatch (manual; can override the seid version)
# - schedule (weekly, Mondays 06:00 UTC)
on:
workflow_dispatch:
inputs:
sei_version:
description: 'seid release tag to build (default: latest GitHub release)'
required: false
type: string
default: ''
schedule:
- cron: '0 6 * * 1'
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout docs
uses: actions/checkout@v4
- name: Resolve seid version
id: version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_VERSION: ${{ inputs.sei_version }}
run: |
set -euo pipefail
requested="${INPUT_VERSION:-}"
if [[ -n "$requested" ]]; then
tag="$requested"
echo "Using requested seid tag: $tag"
else
tag=$(gh api repos/sei-protocol/sei-chain/releases/latest --jq .tag_name)
echo "Resolved latest seid tag: $tag"
fi
if [[ -z "$tag" ]]; then
echo "::error::Could not resolve a seid release tag"
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Checkout sei-chain
uses: actions/checkout@v4
with:
repository: sei-protocol/sei-chain
ref: ${{ steps.version.outputs.tag }}
path: sei-chain
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: sei-chain/go.mod
cache-dependency-path: sei-chain/go.sum
- name: Install build helpers
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends tree
- name: Build seid
working-directory: sei-chain
run: |
set -euo pipefail
export PATH="$(go env GOPATH)/bin:$PATH"
make install
seid version --long || seid version
- name: Capture commit SHA
id: commit
working-directory: sei-chain
run: echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Run seid init
env:
SEI_VERSION: ${{ steps.version.outputs.tag }}
run: |
set -euo pipefail
export PATH="$(go env GOPATH)/bin:$PATH"
rm -rf "$HOME/.sei"
seid init docs-example --chain-id pacific-1
echo "---"
ls -la "$HOME/.sei/config"
- name: Regenerate inlined default configs
env:
SEI_VERSION: ${{ steps.version.outputs.tag }}
SEI_COMMIT: ${{ steps.commit.outputs.sha }}
run: |
export SEI_HOME="$HOME/.sei"
node scripts/sync-default-configs.mjs
- name: Show diff (for log visibility)
run: git --no-pager diff --stat -- node/node-operators.mdx || true
- name: Open pull request if changed
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: bot/sync-default-configs
base: main
commit-message: 'docs(node): sync default configs from seid ${{ steps.version.outputs.tag }}'
title: 'docs(node): sync default configs from seid ${{ steps.version.outputs.tag }}'
body: |
Auto-generated by [`sync-default-configs.yml`](.github/workflows/sync-default-configs.yml).
Refreshes the inlined "Default Configurations" tabs in
`node/node-operators.mdx` from a fresh `seid init`
against [`sei-chain@${{ steps.version.outputs.tag }}`](https://github.com/sei-protocol/sei-chain/releases/tag/${{ steps.version.outputs.tag }})
(commit `${{ steps.commit.outputs.sha }}`).
## What is the purpose of the change?
Keep the documented default `app.toml`, `config.toml`, and
`client.toml` in sync with what node operators actually get when
they install the latest `seid`.
## Describe the changes to the documentation
Updates the marker-bounded TOML blocks inside
`node/node-operators.mdx`. No hand-written prose is touched.
## Notes
If this PR is empty, no defaults changed in the new release.
labels: |
documentation
automated
add-paths: |
node/node-operators.mdx
delete-branch: true