From 107a0e9701eb7f2e9bb877cd995156e96531165d Mon Sep 17 00:00:00 2001
From: Pulumi Bot <30351955+pulumi-bot@users.noreply.github.com>
Date: Tue, 14 May 2024 04:55:39 -0700
Subject: [PATCH] [internal] Update GitHub Actions workflow files (#115)
---
.github/workflows/master.yml | 35 +++------
.github/workflows/prerelease.yml | 71 ++++++++++++-------
.github/workflows/release.yml | 60 ++++++++--------
.github/workflows/run-acceptance-tests.yml | 34 ++-------
devbox.json | 3 +-
.../pulumi-resource-xyz/bridge-metadata.json | 6 +-
provider/cmd/pulumi-resource-xyz/schema.json | 10 ++-
provider/resources.go | 4 ++
sdk/dotnet/Pulumi.Xyz.csproj | 1 +
sdk/dotnet/pulumi-plugin.json | 3 +-
sdk/go/xyz/internal/pulumiUtilities.go | 4 +-
sdk/go/xyz/pulumi-plugin.json | 3 +-
sdk/nodejs/package.json | 5 +-
sdk/python/pulumi_xyz/pulumi-plugin.json | 3 +-
sdk/python/pyproject.toml | 2 +-
15 files changed, 119 insertions(+), 125 deletions(-)
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 5e256f9d..0035665b 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -104,6 +104,13 @@ jobs:
run: make build_${{ matrix.language }}
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
+ with:
+ allowed-changes: |
+ sdk/**/pulumi-plugin.json
+ sdk/dotnet/Pulumi.*.csproj
+ sdk/go/*/internal/pulumiUtilities.go
+ sdk/nodejs/package.json
+ sdk/python/pyproject.toml
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
@@ -260,33 +267,6 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- - if: github.event_name == 'pull_request'
- name: Check Configuration section
- run: |
- sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
- jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
- {
- echo "MISSING_CONFIG<<$EOF";
- xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
- echo "$EOF";
- } >> "$GITHUB_ENV"
-
- - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
- name: Comment on PR with Details of Configuration check
- uses: thollander/actions-comment-pull-request@v2
- with:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- comment_tag: configurationCheck
- message: >+
- ### Is README.md missing any configuration options?
-
- ${{ env.MISSING_CONFIG || 'No missing config!' }}
-
-
- ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
- ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
-
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
@@ -353,6 +333,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
env:
GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }}
+ PROVIDER_VERSION: ${{ steps.version.outputs.version }}
with:
args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout
60m0s
diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml
index 153ca8b1..bfe494b4 100644
--- a/.github/workflows/prerelease.yml
+++ b/.github/workflows/prerelease.yml
@@ -105,6 +105,13 @@ jobs:
run: make build_${{ matrix.language }}
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
+ with:
+ allowed-changes: |
+ sdk/**/pulumi-plugin.json
+ sdk/dotnet/Pulumi.*.csproj
+ sdk/go/*/internal/pulumiUtilities.go
+ sdk/nodejs/package.json
+ sdk/python/pyproject.toml
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
@@ -207,33 +214,6 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- - if: github.event_name == 'pull_request'
- name: Check Configuration section
- run: |
- sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
- jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
- {
- echo "MISSING_CONFIG<<$EOF";
- xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
- echo "$EOF";
- } >> "$GITHUB_ENV"
-
- - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
- name: Comment on PR with Details of Configuration check
- uses: thollander/actions-comment-pull-request@v2
- with:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- comment_tag: configurationCheck
- message: >+
- ### Is README.md missing any configuration options?
-
- ${{ env.MISSING_CONFIG || 'No missing config!' }}
-
-
- ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
- ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
-
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
@@ -300,6 +280,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
env:
GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }}
+ PROVIDER_VERSION: ${{ steps.version.outputs.version }}
with:
args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout
60m0s
@@ -334,6 +315,42 @@ jobs:
if: failure()
name: Send Publish Failure To Slack
uses: rtCamp/action-slack-notify@v2
+ publish_go_sdk:
+ name: publish_go_sdk
+ needs: publish_sdk
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v4
+ - name: Install pulumictl
+ uses: jaxxstorm/action-install-gh-release@v1.11.0
+ with:
+ tag: v0.0.46
+ repo: pulumi/pulumictl
+ - id: version
+ uses: pulumi/provider-version-action@v1
+ - name: Download Go SDK
+ uses: actions/download-artifact@v4
+ with:
+ name: go-sdk.tar.gz
+ path: ${{ github.workspace }}/sdk/
+ - name: Uncompress Go SDK
+ run: tar -zxf ${{ github.workspace }}/sdk/go.tar.gz -C
+ ${{ github.workspace }}/sdk/go
+ shell: bash
+ - uses: pulumi/publish-go-sdk-action@v1
+ with:
+ repository: ${{ github.repository }}
+ base-ref: ${{ github.sha }}
+ source: sdk
+ path: sdk
+ version: ${{ steps.version.outputs.version }}
+ additive: false
+ # Avoid including other language SDKs & artifacts in the commit
+ files: |
+ go.*
+ go/**
+ !*.tar.gz
test:
name: test
needs: build_sdk
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 7767481d..610ed40a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -104,6 +104,13 @@ jobs:
run: make build_${{ matrix.language }}
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
+ with:
+ allowed-changes: |
+ sdk/**/pulumi-plugin.json
+ sdk/dotnet/Pulumi.*.csproj
+ sdk/go/*/internal/pulumiUtilities.go
+ sdk/nodejs/package.json
+ sdk/python/pyproject.toml
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
@@ -221,33 +228,6 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- - if: github.event_name == 'pull_request'
- name: Check Configuration section
- run: |
- sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
- jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
- {
- echo "MISSING_CONFIG<<$EOF";
- xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
- echo "$EOF";
- } >> "$GITHUB_ENV"
-
- - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
- name: Comment on PR with Details of Configuration check
- uses: thollander/actions-comment-pull-request@v2
- with:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- comment_tag: configurationCheck
- message: >+
- ### Is README.md missing any configuration options?
-
- ${{ env.MISSING_CONFIG || 'No missing config!' }}
-
-
- ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
- ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
-
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
@@ -314,6 +294,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
env:
GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }}
+ PROVIDER_VERSION: ${{ steps.version.outputs.version }}
with:
args: -p 3 release --rm-dist --timeout 60m0s
version: latest
@@ -361,9 +342,28 @@ jobs:
repo: pulumi/pulumictl
- id: version
uses: pulumi/provider-version-action@v1
- - name: Add SDK version tag
- run: git tag "sdk/v${{ steps.version.outputs.version }}" && git push origin
- "sdk/v${{ steps.version.outputs.version }}"
+ - name: Download Go SDK
+ uses: actions/download-artifact@v4
+ with:
+ name: go-sdk.tar.gz
+ path: ${{ github.workspace }}/sdk/
+ - name: Uncompress Go SDK
+ run: tar -zxf ${{ github.workspace }}/sdk/go.tar.gz -C
+ ${{ github.workspace }}/sdk/go
+ shell: bash
+ - uses: pulumi/publish-go-sdk-action@v1
+ with:
+ repository: ${{ github.repository }}
+ base-ref: ${{ github.sha }}
+ source: sdk
+ path: sdk
+ version: ${{ steps.version.outputs.version }}
+ additive: false
+ # Avoid including other language SDKs & artifacts in the commit
+ files: |
+ go.*
+ go/**
+ !*.tar.gz
clean_up_release_labels:
name: Clean up release labels
diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml
index b289a197..2ac44a78 100644
--- a/.github/workflows/run-acceptance-tests.yml
+++ b/.github/workflows/run-acceptance-tests.yml
@@ -114,6 +114,13 @@ jobs:
run: make build_${{ matrix.language }}
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
+ with:
+ allowed-changes: |
+ sdk/**/pulumi-plugin.json
+ sdk/dotnet/Pulumi.*.csproj
+ sdk/go/*/internal/pulumiUtilities.go
+ sdk/nodejs/package.json
+ sdk/python/pyproject.toml
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
@@ -231,33 +238,6 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- - if: github.event_name == 'pull_request'
- name: Check Configuration section
- run: |
- sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
- jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
- {
- echo "MISSING_CONFIG<<$EOF";
- xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
- echo "$EOF";
- } >> "$GITHUB_ENV"
-
- - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
- name: Comment on PR with Details of Configuration check
- uses: thollander/actions-comment-pull-request@v2
- with:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- comment_tag: configurationCheck
- message: >+
- ### Is README.md missing any configuration options?
-
- ${{ env.MISSING_CONFIG || 'No missing config!' }}
-
-
- ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
- ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
-
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
diff --git a/devbox.json b/devbox.json
index 4e2ed2c3..1917bf70 100644
--- a/devbox.json
+++ b/devbox.json
@@ -6,7 +6,8 @@
"nodejs@20.",
"python3@3.11.8",
"dotnet-sdk@6.0.",
- "gradle_7@7.6"
+ "gradle_7@7.6",
+ "curl@8"
],
"shell": {
"init_hook": [
diff --git a/provider/cmd/pulumi-resource-xyz/bridge-metadata.json b/provider/cmd/pulumi-resource-xyz/bridge-metadata.json
index ce252c29..2f3220d4 100644
--- a/provider/cmd/pulumi-resource-xyz/bridge-metadata.json
+++ b/provider/cmd/pulumi-resource-xyz/bridge-metadata.json
@@ -2,12 +2,14 @@
"auto-aliasing": {
"resources": {
"xyz_resource": {
- "current": "xyz:index/resource:Resource"
+ "current": "xyz:index/resource:Resource",
+ "majorVersion": 1
}
},
"datasources": {
"xyz_data_source": {
- "current": "xyz:index/dataSource:DataSource"
+ "current": "xyz:index/dataSource:DataSource",
+ "majorVersion": 1
}
}
},
diff --git a/provider/cmd/pulumi-resource-xyz/schema.json b/provider/cmd/pulumi-resource-xyz/schema.json
index 36ddf4a4..ce49b9e9 100644
--- a/provider/cmd/pulumi-resource-xyz/schema.json
+++ b/provider/cmd/pulumi-resource-xyz/schema.json
@@ -19,12 +19,14 @@
"packageReferences": {
"Pulumi": "3.*"
},
- "compatibility": "tfbridge20"
+ "compatibility": "tfbridge20",
+ "respectSchemaVersion": true
},
"go": {
"importBasePath": "github.com/pulumi/pulumi-xyz/sdk/go/xyz",
"generateResourceContainerTypes": true,
- "generateExtraInputTypes": true
+ "generateExtraInputTypes": true,
+ "respectSchemaVersion": true
},
"nodejs": {
"packageDescription": "A Pulumi package for creating and managing xyz cloud resources.",
@@ -37,7 +39,8 @@
"@types/node": "^10.0.0"
},
"compatibility": "tfbridge20",
- "disableUnionOutputTypes": true
+ "disableUnionOutputTypes": true,
+ "respectSchemaVersion": true
},
"python": {
"requires": {
@@ -45,6 +48,7 @@
},
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).",
"compatibility": "tfbridge20",
+ "respectSchemaVersion": true,
"pyproject": {
"enabled": true
}
diff --git a/provider/resources.go b/provider/resources.go
index 8fed0ea6..06aaf5a0 100644
--- a/provider/resources.go
+++ b/provider/resources.go
@@ -126,9 +126,11 @@ func Provider() tfbridge.ProviderInfo {
// section, or refer to the AWS provider. Delete this section if there are
// no overlay files.
// Overlay: &tfbridge.OverlayInfo{},
+ RespectSchemaVersion: true,
},
Python: (func() *tfbridge.PythonInfo {
i := &tfbridge.PythonInfo{
+ RespectSchemaVersion: true,
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
@@ -144,8 +146,10 @@ func Provider() tfbridge.ProviderInfo {
mainPkg,
),
GenerateResourceContainerTypes: true,
+ RespectSchemaVersion: true,
},
CSharp: &tfbridge.CSharpInfo{
+ RespectSchemaVersion: true,
PackageReferences: map[string]string{
"Pulumi": "3.*",
},
diff --git a/sdk/dotnet/Pulumi.Xyz.csproj b/sdk/dotnet/Pulumi.Xyz.csproj
index 114f5ec6..33a8aa61 100644
--- a/sdk/dotnet/Pulumi.Xyz.csproj
+++ b/sdk/dotnet/Pulumi.Xyz.csproj
@@ -9,6 +9,7 @@
https://www.pulumi.com
https://github.com/pulumi/pulumi-xyz
logo.png
+ 1.0.0-alpha.0+dev
net6.0
enable
diff --git a/sdk/dotnet/pulumi-plugin.json b/sdk/dotnet/pulumi-plugin.json
index 3baacc8f..61904146 100644
--- a/sdk/dotnet/pulumi-plugin.json
+++ b/sdk/dotnet/pulumi-plugin.json
@@ -1,4 +1,5 @@
{
"resource": true,
- "name": "xyz"
+ "name": "xyz",
+ "version": "1.0.0-alpha.0+dev"
}
diff --git a/sdk/go/xyz/internal/pulumiUtilities.go b/sdk/go/xyz/internal/pulumiUtilities.go
index 8770c371..e354fc6f 100644
--- a/sdk/go/xyz/internal/pulumiUtilities.go
+++ b/sdk/go/xyz/internal/pulumiUtilities.go
@@ -165,7 +165,7 @@ func callPlainInner(
func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
defaults := []pulumi.ResourceOption{}
- version := SdkVersion
+ version := semver.MustParse("1.0.0-alpha.0+dev")
if !version.Equals(semver.Version{}) {
defaults = append(defaults, pulumi.Version(version.String()))
}
@@ -176,7 +176,7 @@ func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOptio
func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption {
defaults := []pulumi.InvokeOption{}
- version := SdkVersion
+ version := semver.MustParse("1.0.0-alpha.0+dev")
if !version.Equals(semver.Version{}) {
defaults = append(defaults, pulumi.Version(version.String()))
}
diff --git a/sdk/go/xyz/pulumi-plugin.json b/sdk/go/xyz/pulumi-plugin.json
index 3baacc8f..61904146 100644
--- a/sdk/go/xyz/pulumi-plugin.json
+++ b/sdk/go/xyz/pulumi-plugin.json
@@ -1,4 +1,5 @@
{
"resource": true,
- "name": "xyz"
+ "name": "xyz",
+ "version": "1.0.0-alpha.0+dev"
}
diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json
index 82103e06..7e1127fe 100644
--- a/sdk/nodejs/package.json
+++ b/sdk/nodejs/package.json
@@ -1,6 +1,6 @@
{
"name": "@pulumi/xyz",
- "version": "${VERSION}",
+ "version": "1.0.0-alpha.0+dev",
"description": "A Pulumi package for creating and managing xyz cloud resources.",
"keywords": [
"pulumi",
@@ -23,6 +23,7 @@
},
"pulumi": {
"resource": true,
- "name": "xyz"
+ "name": "xyz",
+ "version": "1.0.0-alpha.0+dev"
}
}
diff --git a/sdk/python/pulumi_xyz/pulumi-plugin.json b/sdk/python/pulumi_xyz/pulumi-plugin.json
index 3baacc8f..61904146 100644
--- a/sdk/python/pulumi_xyz/pulumi-plugin.json
+++ b/sdk/python/pulumi_xyz/pulumi-plugin.json
@@ -1,4 +1,5 @@
{
"resource": true,
- "name": "xyz"
+ "name": "xyz",
+ "version": "1.0.0-alpha.0+dev"
}
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml
index 8232a9f8..f0c3dcdc 100644
--- a/sdk/python/pyproject.toml
+++ b/sdk/python/pyproject.toml
@@ -5,7 +5,7 @@
keywords = ["pulumi", "xyz", "category/cloud"]
readme = "README.md"
requires-python = ">=3.7"
- version = "0.0.0"
+ version = "1.0.0a0+dev"
[project.license]
text = "Apache-2.0"
[project.urls]