Skip to content

Commit

Permalink
Embed SDK version (#920)
Browse files Browse the repository at this point in the history
1. Change default config to use push-based Go SDK publishing
2. Use gopatch to enable RespectSchemaVersion in all languages
3. Rebuild SDKs if we've updated the resources.go file

Related to #915 and
pulumi/home#3372
  • Loading branch information
danielrbradley authored May 14, 2024
1 parent a927418 commit c34e73d
Show file tree
Hide file tree
Showing 20 changed files with 824 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,16 @@ publish:
sdk: all
goSdk:
# Set to `true` to use the below configuration to push a new commit somewhere else.
usePush: false
usePush: true
# By default we'll push back to its own repository as a standalone, tagged commit.
repository: ${{ github.repository }}
baseRef: ${{ github.sha }}
source: sdk
path: sdk
additive: false
worktreeAllowedChanges: ''
worktreeAllowedChanges: |-
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/*/internal/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ jobs:
path: #{{ .Config.publish.goSdk.path }}#
version: ${{ steps.version.outputs.version }}
additive: #{{ .Config.publish.goSdk.additive }}#
# Avoid including other language SDKs & artifacts in the commit
files: |
go.*
go/**
!*.tar.gz
#{{- end }}#
test:
name: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ jobs:
path: #{{ .Config.publish.goSdk.path }}#
version: ${{ steps.version.outputs.version }}
additive: #{{ .Config.publish.goSdk.additive }}#
# Avoid including other language SDKs & artifacts in the commit
files: |
go.*
go/**
!*.tar.gz
#{{- else }}#
- name: Add SDK version tag
run: git tag "sdk/v${{ steps.version.outputs.version }}" && git push origin
Expand Down
7 changes: 7 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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
Expand Down
45 changes: 45 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,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
Expand Down Expand Up @@ -320,6 +327,44 @@ 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
with:
submodules: true
- name: Install pulumictl
uses: jaxxstorm/[email protected]
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
Expand Down
32 changes: 29 additions & 3 deletions provider-ci/test-workflows/aws/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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
Expand Down Expand Up @@ -349,9 +356,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -308,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/[email protected]
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -335,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,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
Expand Down
43 changes: 43 additions & 0 deletions provider-ci/test-workflows/docker/.github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,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
Expand Down Expand Up @@ -321,6 +328,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/[email protected]
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
Expand Down
Loading

0 comments on commit c34e73d

Please sign in to comment.