-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/gnot-mintable
- Loading branch information
Showing
9 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# generate docs and publish on gh-pages branch | ||
name: gh-pages | ||
|
||
on: | ||
push: | ||
branches: [$default-branch] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: "cd misc/devdeps && make install" | ||
- run: "cd misc/gendocs && make gen" | ||
- run: "find docs/ -type f -ls" | ||
- uses: actions/configure-pages@v3 | ||
id: pages | ||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ./misc/gendocs/godoc | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
steps: | ||
- uses: actions/deploy-pages@v2 | ||
id: deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
install: | ||
go install mvdan.cc/gofumpt | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go | ||
go install golang.org/x/tools/cmd/godoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
godoc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: clean gen | ||
|
||
gen: | ||
./gendocs.sh | ||
|
||
clean: | ||
rm -rf godoc | ||
|
||
kill_zombies: | ||
kill -9 `lsof -t -i tcp:6060 -s TCP:LISTEN` || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
GODOC_PORT=${GODOC_PORT:-6060} | ||
GO_MODULE=${GO_MODULE:-github.com/gnolang/gno} | ||
GODOC_OUT=${GODOC_OUT:-godoc} | ||
URL=http://localhost:${GODOC_PORT}/pkg/github.com/gnolang/gno/ | ||
|
||
echo "[+] Starting godoc server..." | ||
go run \ | ||
-modfile ../devdeps/go.mod \ | ||
golang.org/x/tools/cmd/godoc \ | ||
-http="localhost:${GODOC_PORT}" & | ||
PID=$! | ||
# Waiting for godoc server | ||
while ! curl --fail --silent "$URL" > /dev/null 2>&1; do | ||
sleep 0.1 | ||
done | ||
|
||
echo "[+] Downloading godoc pages..." | ||
wget \ | ||
--recursive \ | ||
--no-verbose \ | ||
--convert-links \ | ||
--page-requisites \ | ||
--adjust-extension \ | ||
--execute=robots=off \ | ||
--include-directories="/lib,/pkg/$GO_MODULE,/src/$GO_MODULE" \ | ||
--exclude-directories="*" \ | ||
--directory-prefix="${GODOC_OUT}" \ | ||
--no-host-directories \ | ||
"$URL?m=all" | ||
|
||
echo "[+] Killing godoc server..." | ||
kill -9 "$PID" | ||
|