From aa6e068cd4b674fa48b6323ff981e6e33c924635 Mon Sep 17 00:00:00 2001 From: aulorbe Date: Tue, 16 Jul 2024 17:12:07 -0700 Subject: [PATCH 1/3] Add setup file to install go --- .github/actions/build-docs/action.yml | 10 ++++++---- .github/actions/setup/action.yml | 15 +++++++++++++++ .github/workflows/build-and-publish-docs.yml | 3 +++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml index 9d31485..7d1acd9 100644 --- a/.github/actions/build-docs/action.yml +++ b/.github/actions/build-docs/action.yml @@ -1,8 +1,12 @@ -name: 'Build client documentation' +name: 'Generate client documentation' description: 'Generates client documentation using godoc' + runs: using: 'composite' steps: + - name: Check out the repository + uses: actions/checkout@v4 + - name: Write html file to docs directory shell: bash run: | @@ -13,7 +17,5 @@ runs: echo "Directory ./docs does not exist. Creating it now..." mkdir ./docs fi - - # Run the godoc command godoc -url pkg/github.com/pinecone-io/go-pinecone/pinecone/ > ./docs/index.html - echo "godoc command has been executed and the output has been saved to ./docs/index.html" + echo "godoc command has been executed and the output has been saved to ./docs/index.html" \ No newline at end of file diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..6a6c2ad --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,15 @@ +name: 'Setup Go' +description: 'Sets up Go using actions/setup-go@v5' +inputs: + go-version: + description: 'The version of Go to use' + required: true + default: '1.21' + +runs: + using: 'composite' + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ inputs.go-version }} \ No newline at end of file diff --git a/.github/workflows/build-and-publish-docs.yml b/.github/workflows/build-and-publish-docs.yml index 994d345..f26981c 100644 --- a/.github/workflows/build-and-publish-docs.yml +++ b/.github/workflows/build-and-publish-docs.yml @@ -14,6 +14,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Setup Go + uses: ./.github/actions/setup/action.yml + - name: Generate Go documentation uses: ./.github/actions/build-docs From 7f644c10c58d4e22bc2fd57f33206e01a1f6f478 Mon Sep 17 00:00:00 2001 From: aulorbe Date: Tue, 16 Jul 2024 17:14:45 -0700 Subject: [PATCH 2/3] add downloading of deps --- .github/actions/setup/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 6a6c2ad..115772e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,4 +12,8 @@ runs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ inputs.go-version }} \ No newline at end of file + go-version: ${{ inputs.go-version }} + + - name: Install Go dependencies + shell: bash + run: go mod download From 38e0f51a8d4b7c8b6516c12ad5e7de0839544e2c Mon Sep 17 00:00:00 2001 From: aulorbe Date: Tue, 16 Jul 2024 17:15:48 -0700 Subject: [PATCH 3/3] adding godoc install --- .github/actions/setup/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 115772e..5efcebd 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,3 +17,7 @@ runs: - name: Install Go dependencies shell: bash run: go mod download + + - name: Install godoc + shell: bash + run: go install golang.org/x/tools/cmd/godoc@latest