From 9b789f37428569a2af8bfde4931cb0e7dfad74c2 Mon Sep 17 00:00:00 2001 From: Pulumi Bot <30351955+pulumi-bot@users.noreply.github.com> Date: Wed, 1 May 2024 07:49:27 -0700 Subject: [PATCH] Update GitHub Actions workflows. (#56) This PR was automatically generated by the update-native-provider-workflows workflow in the pulumi/ci-mgmt repo, from commit 8d27f1f4eb9d34f0b7ccf790b1d2e06b7fa92be6. This also manually updates the makefile to add the PROVIDER_VERSION argument. --------- Co-authored-by: Daniel Bradley --- .github/workflows/build.yml | 44 ++++++++++---------- .github/workflows/prerelease.yml | 44 ++++++++++---------- .github/workflows/release.yml | 48 ++++++++++++---------- .github/workflows/run-acceptance-tests.yml | 28 +++++-------- .github/workflows/weekly-pulumi-update.yml | 4 ++ Makefile | 19 +++++---- 6 files changed, 97 insertions(+), 90 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 861066c..17417b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,12 +64,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -121,7 +119,7 @@ jobs: - name: Build Provider run: make provider - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ @@ -163,12 +161,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -221,7 +217,7 @@ jobs: - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . @@ -260,12 +256,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -379,6 +373,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -435,6 +433,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Checkout Scripts Repo uses: actions/checkout@v4 with: @@ -515,12 +517,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 27af176..30761a6 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -56,12 +56,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -113,7 +111,7 @@ jobs: - name: Build Provider run: make provider - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ @@ -155,12 +153,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -213,7 +209,7 @@ jobs: - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . @@ -251,12 +247,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -370,6 +364,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -426,6 +424,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Checkout Scripts Repo uses: actions/checkout@v4 with: @@ -506,12 +508,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c790f57..c41d0ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,12 +56,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -113,7 +111,7 @@ jobs: - name: Build Provider run: make provider - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ @@ -155,12 +153,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -213,7 +209,7 @@ jobs: - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . @@ -251,12 +247,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -370,6 +364,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -426,6 +424,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Checkout Scripts Repo uses: actions/checkout@v4 with: @@ -506,12 +508,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -560,6 +560,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.11.0 with: diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index f90a73b..5fe0052 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -81,12 +81,10 @@ jobs: with: lfs: true ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -138,7 +136,7 @@ jobs: - name: Build Provider run: make provider - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ @@ -183,12 +181,10 @@ jobs: with: lfs: true ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go @@ -241,7 +237,7 @@ jobs: - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - run: git status --porcelain - name: Tar SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . @@ -283,12 +279,10 @@ jobs: with: lfs: true ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - - run: echo "ci-scripts" >> .git/info/exclude + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go diff --git a/.github/workflows/weekly-pulumi-update.yml b/.github/workflows/weekly-pulumi-update.yml index b0826d2..21231a8 100644 --- a/.github/workflows/weekly-pulumi-update.yml +++ b/.github/workflows/weekly-pulumi-update.yml @@ -54,6 +54,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + - name: Set Provider Version + uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go diff --git a/Makefile b/Makefile index 6256f7e..8842830 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ NODE_MODULE_NAME := @pulumi/docker-build NUGET_PKG_NAME := Pulumi.DockerBuild PROVIDER := pulumi-resource-${PACK} -VERSION ?= $(shell pulumictl get version) PROVIDER_PATH := provider VERSION_PATH := ${PROVIDER_PATH}.Version SCHEMA_PATH := ${PROVIDER_PATH}/cmd/pulumi-resource-${PACK}/schema.json @@ -21,6 +20,12 @@ TESTPARALLELISM := 4 PULUMI := bin/pulumi GOGLANGCILINT := bin/golangci-lint +# Override during CI using `make [TARGET] PROVIDER_VERSION=""` or by setting a PROVIDER_VERSION environment variable +# Local & branch builds will just used this fixed default version unless specified +PROVIDER_VERSION ?= 1.0.0-alpha.0+dev +# Use this normalised version everywhere rather than the raw input to ensure consistency. +VERSION_GENERIC = $(shell pulumictl convert-version --language generic --version "$(PROVIDER_VERSION)") + .PHONY: ensure ensure:: tidy lint test_provider examples @@ -35,7 +40,7 @@ provider: bin/${PROVIDER} bin/pulumi-gen-${PACK} # Required by CI local_generate: sdk # Required by CI provider_debug:: - (cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags="all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) + (cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags="all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION_GENERIC}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) test_provider:: # Required by CI go test -short -v -coverprofile="coverage.txt" -coverpkg=./provider/... -timeout 2h -parallel ${TESTPARALLELISM} ./provider/... @@ -176,7 +181,7 @@ ${SCHEMA_PATH}: bin/${PROVIDER} pulumi package get-schema bin/${PROVIDER} > $(SCHEMA_PATH) bin/${PROVIDER}: $(shell find ./provider -name '*.go') go.mod - (cd provider && go build -o ../bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) + (cd provider && go build -o ../bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION_GENERIC}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) bin/pulumi-gen-${PACK}: # Required by CI touch bin/pulumi-gen-${PACK} @@ -187,7 +192,7 @@ go.sum: go.mod sdk: $(shell mkdir -p sdk) sdk: sdk/python sdk/nodejs sdk/java sdk/python sdk/go sdk/dotnet -sdk/python: PYPI_VERSION := $(shell pulumictl get version --language python) +sdk/python: PYPI_VERSION := $(shell pulumictl convert-version --language python -v "$(VERSION_GENERIC)") sdk/python: TMPDIR := $(shell mktemp -d) sdk/python: $(PULUMI) bin/${PROVIDER} rm -rf sdk/python @@ -203,7 +208,7 @@ sdk/python: $(PULUMI) bin/${PROVIDER} ../venv/bin/python -m build . mv -f ${TMPDIR}/python ${WORKING_DIR}/sdk/. -sdk/nodejs: NODE_VERSION := $(shell pulumictl get version --language javascript) +sdk/nodejs: NODE_VERSION := $(shell pulumictl convert-version --language javascript -v "$(VERSION_GENERIC)") sdk/nodejs: TMPDIR := $(shell mktemp -d) sdk/nodejs: $(PULUMI) bin/${PROVIDER} rm -rf sdk/nodejs @@ -228,7 +233,7 @@ sdk/go: $(PULUMI) bin/${PROVIDER} go mod tidy mv -f ${TMPDIR}/go ${WORKING_DIR}/sdk/go -sdk/dotnet: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) +sdk/dotnet: DOTNET_VERSION := $(shell pulumictl convert-version --language dotnet -v "$(VERSION_GENERIC)") sdk/dotnet: TMPDIR := $(shell mktemp -d) sdk/dotnet: $(PULUMI) bin/${PROVIDER} rm -rf sdk/dotnet @@ -238,7 +243,7 @@ sdk/dotnet: $(PULUMI) bin/${PROVIDER} dotnet build /p:Version=${DOTNET_VERSION} mv -f ${TMPDIR}/dotnet ${WORKING_DIR}/sdk/. -sdk/java: PACKAGE_VERSION := $(shell pulumictl get version --language generic) +sdk/java: PACKAGE_VERSION := $(shell pulumictl convert-version --language generic -v "$(VERSION_GENERIC)") sdk/java: TMPDIR := $(shell mktemp -d) sdk/java: $(PULUMI) bin/${PROVIDER} rm -rf sdk/java