Skip to content

Commit

Permalink
Embed SDK version (#1297)
Browse files Browse the repository at this point in the history
Part of pulumi/ci-mgmt#915

Bring workflows in line with the approach used in other providers.

1. Use action for checking for unexpected changes - and allow files with
the version embedded to change once we've enabled
`respectSchemaVersion`.
2. Fix how we calculate the version we're building. Stop relying on the
local git checkout to contain all tags. Use a placeholder locally and
override the placeholder in CI with the version calculated from our
action.
    - Remove fetching all tags.
3. (Pending) enable `respectSchemaVersion`.
  • Loading branch information
danielrbradley authored Jun 7, 2024
1 parent 1e5fee9 commit c94dc01
Show file tree
Hide file tree
Showing 17 changed files with 301 additions and 194 deletions.
63 changes: 38 additions & 25 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ env:
NODEVERSION: "18.x"
JAVAVERSION: "11"
jobs:
version:
uses: ./.github/workflows/version.yml
secrets: inherit
lint:
name: lint
runs-on: ubuntu-latest
continue-on-error: true
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -59,17 +58,22 @@ jobs:
- name: Lint classic AWSX Code
run: make lint_classic
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
build-provider:
runs-on: ubuntu-latest
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
Expand All @@ -79,8 +83,6 @@ jobs:
role-duration-seconds: 3600
role-session-name: ${{ env.PROVIDER }}@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v4
with:
Expand All @@ -107,7 +109,14 @@ jobs:
- name: Test provider
run: make test_provider
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
- name: Upload bin
uses: actions/upload-artifact@v3
with:
Expand All @@ -128,8 +137,12 @@ jobs:
fields: repo,commit,author,action
status: ${{ job.status }}
acceptance-test:
needs: build-provider
runs-on: ubuntu-latest
needs:
- build-provider
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
Expand All @@ -138,13 +151,6 @@ jobs:
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -167,7 +173,14 @@ 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
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/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 }}
.
Expand Down
84 changes: 48 additions & 36 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ env:
NODEVERSION: "18.x"
JAVAVERSION: "11"
jobs:
version:
uses: ./.github/workflows/version.yml
secrets: inherit
lint:
name: lint
runs-on: ubuntu-latest
continue-on-error: true
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -59,9 +58,19 @@ jobs:
- name: Lint classic AWSX Code
run: make lint_classic
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
build-provider:
runs-on: ubuntu-latest
needs: version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -74,13 +83,6 @@ jobs:
role-duration-seconds: 3600
role-session-name: ${{ env.PROVIDER }}@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v4
with:
Expand All @@ -107,7 +109,14 @@ jobs:
- name: Test provider
run: make test_provider
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
- name: Upload bin
uses: actions/upload-artifact@v3
with:
Expand All @@ -128,8 +137,12 @@ jobs:
fields: repo,commit,author,action
status: ${{ job.status }}
acceptance-test:
needs: build-provider
runs-on: ubuntu-latest
needs:
- build-provider
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
Expand All @@ -138,13 +151,6 @@ jobs:
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -171,7 +177,14 @@ 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
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/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 }}
.
Expand Down Expand Up @@ -203,13 +216,15 @@ jobs:
- java
publish:
name: publish
needs: acceptance-test
runs-on: ubuntu-latest
needs:
- acceptance-test
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
Expand Down Expand Up @@ -248,18 +263,15 @@ jobs:
run: aws s3 cp dist s3://get.pulumi.com/releases/plugins/ --recursive
publish_sdk:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
needs:
- publish
- version
env:
PROVIDER_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand Down
Loading

0 comments on commit c94dc01

Please sign in to comment.