BUILD: Move regen steps to a script (#3491)

This commit is contained in:
Tom Limoncelli 2025-03-17 09:06:32 -04:00 committed by GitHub
parent 5dafc9c1e3
commit 0d8dcea63a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 15 deletions

17
bin/generate-all.sh Executable file
View 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

View file

@ -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