mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-07 13:44:18 +08:00
BUILD: Move regen steps to a script (#3491)
This commit is contained in:
parent
5dafc9c1e3
commit
0d8dcea63a
2 changed files with 23 additions and 15 deletions
17
bin/generate-all.sh
Executable file
17
bin/generate-all.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
go fmt ./...
|
||||
|
||||
if [[ -x node_modules/.bin/prettier ]]; then
|
||||
node_modules/.bin/prettier --write pkg/js/helpers.js
|
||||
fi
|
||||
|
||||
# JSON
|
||||
bin/fmtjson $(find . -type f -name \*.json -print)
|
||||
|
||||
# dnsconfig.js-compatible files:
|
||||
for i in pkg/js/parse_tests/*.js ; do dnscontrol fmt -i $i -o $i ; done
|
||||
|
||||
go generate ./...
|
||||
|
||||
go mod tidy
|
|
@ -15,27 +15,18 @@ git checkout -b update_deps
|
|||
go install github.com/oligot/go-mod-upgrade@latest
|
||||
go-mod-upgrade
|
||||
go mod tidy
|
||||
git commit -a -m "CHORE: Update dependencies"
|
||||
git commit -m "CHORE: Update dependencies" go.sum go.mod
|
||||
```
|
||||
|
||||
## Step 1. Rebuild generated files
|
||||
|
||||
```shell
|
||||
git checkout main
|
||||
git pull
|
||||
go fmt ./...
|
||||
bin/fmtjson $(find . -type f -name \*.json -print)
|
||||
for i in pkg/js/parse_tests/*.js ; do dnscontrol fmt -i $i -o $i ; done
|
||||
go generate ./...
|
||||
go mod tidy
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
git checkout -b generate
|
||||
bin/generate-all.sh
|
||||
git status
|
||||
```
|
||||
|
||||
There should be no modified files. If there are, check them in then start over from the beginning:
|
||||
|
||||
```
|
||||
git checkout -b gogenerate
|
||||
git commit -a -m "Update generated files"
|
||||
git commit -am "CHORE: generate-all.sh"
|
||||
```
|
||||
|
||||
## Step 2. Tag the commit in main that you want to release
|
||||
|
|
Loading…
Add table
Reference in a new issue