From 522b7e0d929530d0a753bac01742028585c68473 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 22:46:36 -0400 Subject: [PATCH 1/6] Use existing secret name in docs publish step --- .github/workflows/cli.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index a7c395af9b..61c9474cef 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -94,7 +94,7 @@ jobs: git diff --cached --exit-code publish: - if: startswith(github.ref, 'refs/tags/') + #if: startswith(github.ref, 'refs/tags/') name: publish runs-on: ubuntu-latest steps: @@ -104,5 +104,5 @@ jobs: - name: Publish Docs uses: mhausenblas/mkdocs-deploy-gh-pages@master env: - GITHUB_TOKEN: ${{ secrets.MKDOCS_PUBLISH_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REQUIREMENTS: mkdocs-requirements.txt From 70e1ed4c9d8f80940cbfc3c7328ecb626e709cc2 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 22:58:46 -0400 Subject: [PATCH 2/6] Attempt to work around materialx yaml loader boom --- .github/workflows/cli.yml | 1 + mkdocs-requirements.txt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 61c9474cef..77840f79c0 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -96,6 +96,7 @@ jobs: publish: #if: startswith(github.ref, 'refs/tags/') name: publish + needs: [test-docs] runs-on: ubuntu-latest steps: - name: Checkout Code diff --git a/mkdocs-requirements.txt b/mkdocs-requirements.txt index 1c2f87447a..482ad0622d 100644 --- a/mkdocs-requirements.txt +++ b/mkdocs-requirements.txt @@ -1,4 +1,5 @@ -mkdocs~=1.3 -mkdocs-material~=8.2 mkdocs-git-revision-date-localized-plugin~=1.0 +mkdocs-material-extensions~=1.0 +mkdocs-material~=8.2 +mkdocs~=1.3 pygments~=2.12 From 5988cc604001d76f5a32195f7a3390dfbd3e3570 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 23:13:45 -0400 Subject: [PATCH 3/6] Try running mkdocs steps directly --- .github/workflows/cli.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 77840f79c0..cf88e912ba 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -12,6 +12,7 @@ on: jobs: test: + if: false strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -102,8 +103,13 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Setup mkdocs + run: | + pip install -U pip + pip install -r mkdocs-requirements.txt + git remote rm origin + git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/urfave/cli.git + - name: Publish Docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REQUIREMENTS: mkdocs-requirements.txt + run: | + mkdocs gh-deploy --force From e592640fdb667f72992236770f1c76551b66b9b2 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 23:17:57 -0400 Subject: [PATCH 4/6] Unshallow the clone + toc cleanups --- .github/workflows/cli.yml | 14 ++++++-------- Makefile | 6 +----- internal/build/build.go | 13 ------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index cf88e912ba..cedc051bbd 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -77,18 +77,14 @@ jobs: uses: actions/checkout@v3 - name: Install Dependencies - run: - mkdir -p "${GITHUB_WORKSPACE}/.local/bin" && - curl -fsSL -o "${GITHUB_WORKSPACE}/.local/bin/gfmrun" "https://github.com/urfave/gfmrun/releases/download/v1.3.0/gfmrun-$(go env GOOS)-$(go env GOARCH)-v1.3.0" && - chmod +x "${GITHUB_WORKSPACE}/.local/bin/gfmrun" && - npm install -g markdown-toc@1.2.0 + run: > + mkdir -p "${GITHUB_WORKSPACE}/.local/bin" + curl -fsSL -o "${GITHUB_WORKSPACE}/.local/bin/gfmrun" "https://github.com/urfave/gfmrun/releases/download/v1.3.0/gfmrun-$(go env GOOS)-$(go env GOARCH)-v1.3.0" + chmod +x "${GITHUB_WORKSPACE}/.local/bin/gfmrun" - name: gfmrun run: go run internal/build/build.go gfmrun docs/v2/manual.md - - name: toc - run: go run internal/build/build.go toc docs/v2/manual.md - - name: diff check run: | git diff --exit-code @@ -102,6 +98,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup mkdocs run: | diff --git a/Makefile b/Makefile index ba783cb426..3b0e5e0bbd 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # attention on files that are primarily Go. .PHONY: all -all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun toc v2diff +all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun v2diff # NOTE: this is a special catch-all rule to run any of the commands # defined in internal/build/build.go with optional arguments passed @@ -27,10 +27,6 @@ tag-check-binary-size: gfmrun: go run internal/build/build.go gfmrun docs/v2/manual.md -.PHONY: toc -toc: - go run internal/build/build.go toc docs/v2/manual.md - .PHONY: docs docs: mkdocs build diff --git a/internal/build/build.go b/internal/build/build.go index 929ab0fbf9..26967605b5 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -63,10 +63,6 @@ func main() { Name: "gfmrun", Action: GfmrunActionFunc, }, - { - Name: "toc", - Action: TocActionFunc, - }, { Name: "check-binary-size", Action: checkBinarySizeActionFunc, @@ -216,15 +212,6 @@ func GfmrunActionFunc(c *cli.Context) error { return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", filename) } -func TocActionFunc(c *cli.Context) error { - filename := c.Args().Get(0) - if filename == "" { - filename = "README.md" - } - - return runCmd("markdown-toc", "-i", filename) -} - // checkBinarySizeActionFunc checks the size of an example binary to ensure that we are keeping size down // this was originally inspired by https://github.com/urfave/cli/issues/1055, and followed up on as a part // of https://github.com/urfave/cli/issues/1057 From e7f3925a5ab86b2df8f7c3b19d5f48651553c3ce Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 23:19:10 -0400 Subject: [PATCH 5/6] Use correct yaml multiline :facepalm: --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index cedc051bbd..7c55139621 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v3 - name: Install Dependencies - run: > + run: | mkdir -p "${GITHUB_WORKSPACE}/.local/bin" curl -fsSL -o "${GITHUB_WORKSPACE}/.local/bin/gfmrun" "https://github.com/urfave/gfmrun/releases/download/v1.3.0/gfmrun-$(go env GOOS)-$(go env GOARCH)-v1.3.0" chmod +x "${GITHUB_WORKSPACE}/.local/bin/gfmrun" From b3359c3e2754318c4b52948c8779d41c37b9e1cc Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 18 May 2022 23:20:47 -0400 Subject: [PATCH 6/6] Re-enable workflow conditions --- .github/workflows/cli.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 7c55139621..3b31afc5c0 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -12,7 +12,6 @@ on: jobs: test: - if: false strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -91,7 +90,7 @@ jobs: git diff --cached --exit-code publish: - #if: startswith(github.ref, 'refs/tags/') + if: startswith(github.ref, 'refs/tags/') name: publish needs: [test-docs] runs-on: ubuntu-latest