Skip to content

Commit

Permalink
Verify actual published Python SDK version (#1220)
Browse files Browse the repository at this point in the history
Fixes #1219

Extract SDK version after publishing the Python SDK. The SDK is
downloaded internally by the pulumi-package-publisher action.

The xyz provider does not have a python example so we will need to
manually test this against another provider.
  • Loading branch information
danielrbradley authored Dec 12, 2024
1 parent 6bd2b2f commit 84bf03d
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
name: publish_sdk
needs: publish
runs-on: #{{ .Config.Runner.Default }}#
outputs:
python_version: ${{ steps.python_version.outputs.version }}
steps:
- name: Checkout Repo
uses: #{{ .Config.ActionVersions.Checkout }}#
Expand Down Expand Up @@ -147,6 +149,13 @@ jobs:
go.*
go/**
!*.tar.gz
- name: Extract python version
id: python_version
working-directory: sdk/python
run: |
pip install toml-cli==0.7.0
version=$(toml get --toml-path pyproject.toml project.version)
echo "version=${version}" >> "$GITHUB_OUTPUT"
#{{- if .Config.PublishRegistry }}#
create_docs_build:
Expand Down Expand Up @@ -204,3 +213,4 @@ jobs:
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
enableMacosRunner: ${{ inputs.isPrerelease == false }}
skipGoSdk: ${{ inputs.skipGoSdk }}
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false
workflow_call:
inputs:
providerVersion:
Expand All @@ -32,6 +36,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false

env:
#{{ .Config.Env | toYaml | indent 2 }}#
Expand Down Expand Up @@ -89,6 +97,7 @@ jobs:
directory: #{{ .Config.ReleaseVerification.Python }}#
provider: #{{ .Config.Provider }}#
providerVersion: ${{ inputs.providerVersion }}
packageVersion: ${{ inputs.pythonVersion || inputs.providerVersion }}
#{{- end }}#
#{{- if .Config.ReleaseVerification.Dotnet }}#
- name: Verify dotnet release
Expand Down
10 changes: 10 additions & 0 deletions provider-ci/test-providers/acme/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
outputs:
python_version: ${{ steps.python_version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -140,6 +142,13 @@ jobs:
go.*
go/**
!*.tar.gz
- name: Extract python version
id: python_version
working-directory: sdk/python
run: |
pip install toml-cli==0.7.0
version=$(toml get --toml-path pyproject.toml project.version)
echo "version=${version}" >> "$GITHUB_OUTPUT"
clean_up_release_labels:
name: Clean up release labels
Expand Down Expand Up @@ -172,3 +181,4 @@ jobs:
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
enableMacosRunner: ${{ inputs.isPrerelease == false }}
skipGoSdk: ${{ inputs.skipGoSdk }}
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false
workflow_call:
inputs:
providerVersion:
Expand All @@ -32,6 +36,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 10 additions & 0 deletions provider-ci/test-providers/aws/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ jobs:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
outputs:
python_version: ${{ steps.python_version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -157,6 +159,13 @@ jobs:
go.*
go/**
!*.tar.gz
- name: Extract python version
id: python_version
working-directory: sdk/python
run: |
pip install toml-cli==0.7.0
version=$(toml get --toml-path pyproject.toml project.version)
echo "version=${version}" >> "$GITHUB_OUTPUT"
create_docs_build:
name: create_docs_build
needs: publish_sdk
Expand Down Expand Up @@ -208,3 +217,4 @@ jobs:
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
enableMacosRunner: ${{ inputs.isPrerelease == false }}
skipGoSdk: ${{ inputs.skipGoSdk }}
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false
workflow_call:
inputs:
providerVersion:
Expand All @@ -32,6 +36,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false

env:
AWS_REGION: us-west-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ jobs:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
outputs:
python_version: ${{ steps.python_version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -154,6 +156,13 @@ jobs:
go.*
go/**
!*.tar.gz
- name: Extract python version
id: python_version
working-directory: sdk/python
run: |
pip install toml-cli==0.7.0
version=$(toml get --toml-path pyproject.toml project.version)
echo "version=${version}" >> "$GITHUB_OUTPUT"
create_docs_build:
name: create_docs_build
needs: publish_sdk
Expand Down Expand Up @@ -205,3 +214,4 @@ jobs:
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
enableMacosRunner: ${{ inputs.isPrerelease == false }}
skipGoSdk: ${{ inputs.skipGoSdk }}
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false
workflow_call:
inputs:
providerVersion:
Expand All @@ -32,6 +36,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false

env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand Down
10 changes: 10 additions & 0 deletions provider-ci/test-providers/docker/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ jobs:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
outputs:
python_version: ${{ steps.python_version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -167,6 +169,13 @@ jobs:
go.*
go/**
!*.tar.gz
- name: Extract python version
id: python_version
working-directory: sdk/python
run: |
pip install toml-cli==0.7.0
version=$(toml get --toml-path pyproject.toml project.version)
echo "version=${version}" >> "$GITHUB_OUTPUT"
create_docs_build:
name: create_docs_build
needs: publish_sdk
Expand Down Expand Up @@ -218,3 +227,4 @@ jobs:
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
enableMacosRunner: ${{ inputs.isPrerelease == false }}
skipGoSdk: ${{ inputs.skipGoSdk }}
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false
workflow_call:
inputs:
providerVersion:
Expand All @@ -32,6 +36,10 @@ on:
required: false
type: boolean
default: false
pythonVersion:
description: "Optional python SDK version to verify. Defaults to inputs.providerVersion."
type: string
required: false

env:
ARM_CLIENT_ID: 30e520fa-12b4-4e21-b473-9426c5ac2e1e
Expand Down

0 comments on commit 84bf03d

Please sign in to comment.