From 5a17ba73e78c00ac4fcfc37e958aa84929d5899a Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 21 Sep 2023 15:34:05 -0400 Subject: [PATCH 1/5] makefile: remove old docs targets Since we moved the docs to integrations, we don't need to build the docs.zip file anymore, and to make it easier for plugin developers we move the logic for building the new .docs directory to the `generate' Makefile target. --- GNUmakefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index f56a8c4b..45feb339 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -20,10 +20,6 @@ test: install-packer-sdc: ## Install packer sofware development command @go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION} -ci-release-docs: install-packer-sdc - @packer-sdc renderdocs -src docs -partials docs-partials/ -dst docs/ - @/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/" - plugin-check: install-packer-sdc build @packer-sdc plugin-check ${BINARY} @@ -34,9 +30,7 @@ generate: install-packer-sdc @go generate ./... packer-sdc renderdocs -src ./docs -dst ./.docs -partials ./docs-partials # checkout the .docs folder for a preview of the docs - -build-docs: install-packer-sdc - @if [ -d ".docs" ]; then rm -r ".docs"; fi + @rm -rf .docs @packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/" @./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "hashicorp" @rm -r ".docs" From 6abfe6b012641b58885f27892111c7fdfe81f60c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 21 Sep 2023 15:53:42 -0400 Subject: [PATCH 2/5] .github: remove ensure-docs-compiled workflow Since the workflow relies on the build-docs target existing in the Makefile to ensure we don't commit a change without calling it, and since we removed it in the previous commit to fold it in generate, we don't need it anymore so we can remove it. Since the `make generate' call is already required if modifying the docs, and we check that during validate, this is safe to remove. --- .github/workflows/ensure-docs-compiled.yaml | 22 --------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/ensure-docs-compiled.yaml diff --git a/.github/workflows/ensure-docs-compiled.yaml b/.github/workflows/ensure-docs-compiled.yaml deleted file mode 100644 index 74a174d3..00000000 --- a/.github/workflows/ensure-docs-compiled.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Ensure Docs are Compiled -on: - push: -jobs: - ensure-docs-compiled: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - - shell: bash - run: make build-docs - - shell: bash - run: | - if [[ -z "$(git status -s)" ]]; then - echo "OK" - else - echo "Docs have been updated, but the compiled docs have not been committed." - echo "Run 'make build-docs', and commit the result to resolve this error." - exit 1 - fi - From def0845f6a13c754c9b658a30d97df8d616b3178 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 21 Sep 2023 16:43:27 -0400 Subject: [PATCH 3/5] Makefile: remove superfluous renderdocs Since we have merged `build-docs' with `generate', we don't need to manually invoke `packer-sdc renderdocs' before the old build-docs. --- GNUmakefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 45feb339..06590c4f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -28,8 +28,6 @@ testacc: dev generate: install-packer-sdc @go generate ./... - packer-sdc renderdocs -src ./docs -dst ./.docs -partials ./docs-partials - # checkout the .docs folder for a preview of the docs @rm -rf .docs @packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/" @./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "hashicorp" From 34c168e1dde8286ffcda3159fb43c799fc960715 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 26 Sep 2023 14:53:22 -0400 Subject: [PATCH 4/5] goreleaser: don't rely on ci-make-docs Since the ci-make-docs target is no longer part of the Makefile, we cannot rely on it for making the latest docs, and therefore we must remove that from the goreleaser file too. --- .goreleaser.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 1c48ac23..2a2e43ec 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,9 +10,6 @@ before: # We strongly recommend running tests to catch any regression before release. # Even though, this an optional step. - go test ./... - # As part of the release doc files are included as a separate deliverable for - # consumption by Packer.io. To include a separate docs.zip uncomment the following command. - - make ci-release-docs # Check plugin compatibility with required version of the Packer SDK - make plugin-check builds: From 134d1145e167bfe1b21031e6f2a7e746fd6cb04e Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 26 Sep 2023 15:51:16 -0400 Subject: [PATCH 5/5] goreleaser: don't include docs.zip in release The docs.zip file should not be part of the release as it is no longer generated nor required to build the docs for a plugin. Keeping this in the releaser config caused the release to fail before the artifacts were updated, leading to a corrupted release. --- .goreleaser.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 2a2e43ec..f9dbc171 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -95,13 +95,6 @@ signs: args: ["sign", "--dearmor", "--file", "${artifact}", "--out", "${signature}"] artifacts: checksum signature: ${artifact}.sig -release: - # If you want to manually examine the release before its live, uncomment this line: - # draft: true - # As part of the release doc files are included as a separate deliverable for consumption by Packer.io. - # To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above. - extra_files: - - glob: ./docs.zip changelog: use: github-native