-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using goreleaser, improve our release notes, speed up releases. - Fixes #1013 - Closes #816 - Partially addresses #731 - Related to #967 This should also save 3 hours of waiting per release of AWS. Build cross-platform provider binaries, in parallel, straight after prerequisites, then only calculate hashes & push to S3 and GitHub releases directly during the publish job. Specifics: - Use GitHub's own release notes generator which allows us to suppliment with our own context - specifically the schema change since the previous latest release. - Capture and restore the `schema-embed.json` to avoid having to run `tfgen` on every provider build. - Build the multi-platform build straight into the makefile for easier local testing. - Remove clearing disk space during publish as we're not doing any build work there any more. This does not include reworking tests to use the the provider binary being released - but this can be added later fairly easily.
- Loading branch information
1 parent
25f2991
commit e869944
Showing
34 changed files
with
726 additions
and
104 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_provider.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: "Build Provider" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
description: Version of the provider to build | ||
|
||
jobs: | ||
build_provider: | ||
name: Build ${{ matrix.platform.os }}-${{ matrix.platform.arch }} | ||
runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}# | ||
env: | ||
PROVIDER_VERSION: ${{ inputs.version }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: | ||
- os: linux | ||
arch: amd64 | ||
- os: linux | ||
arch: arm64 | ||
- os: darwin | ||
arch: amd64 | ||
- os: darwin | ||
arch: arm64 | ||
- os: windows | ||
arch: amd64 | ||
steps: | ||
#{{- if .Config.freeDiskSpaceBeforeBuild }}# | ||
# Run as first step so we don't delete things that have just been installed | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be | ||
with: | ||
tool-cache: false | ||
swap-storage: false | ||
#{{- end }}# | ||
- name: Checkout Repo | ||
uses: #{{ .Config.actionVersions.checkout }}# | ||
#{{- if .Config.checkoutSubmodules }}# | ||
with: | ||
submodules: #{{ .Config.checkoutSubmodules }}# | ||
#{{- end }}# | ||
- name: Setup tools | ||
uses: ./.github/actions/setup-tools | ||
with: | ||
tools: pulumictl, go | ||
- name: Download schema-embed.json | ||
uses: #{{ .Config.actionVersions.downloadArtifact }}# | ||
with: | ||
name: schema-embed.json | ||
path: provider/cmd/pulumi-resource-#{{ .Config.provider }}#/schema-embed.json | ||
- name: Prepare for build | ||
# This installs plugins and prepares upstream | ||
run: make upstream | ||
- name: Build & package provider | ||
run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} | ||
- name: Upload artifacts | ||
uses: #{{ .Config.actionVersions.uploadArtifact }}# | ||
with: | ||
name: pulumi-resource-#{{ .Config.provider }}#-v${{ inputs.version }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.tar.gz | ||
path: bin/pulumi-resource-#{{ .Config.provider }}#-v${{ inputs.version }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.tar.gz | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,6 @@ jobs: | |
- name: Validate skipGoSdk | ||
if: inputs.skipGoSdk && inputs.isPrerelease == false | ||
run: echo "Can't skip Go SDK for stable releases. This is likely a bug in the calling workflow." && exit 1 | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
swap-storage: false | ||
- name: Checkout Repo | ||
uses: #{{ .Config.actionVersions.checkout }}# | ||
#{{- if .Config.checkoutSubmodules }}# | ||
|
@@ -46,7 +39,7 @@ jobs: | |
- name: Setup tools | ||
uses: ./.github/actions/setup-tools | ||
with: | ||
tools: pulumictl, pulumicli, go | ||
tools: pulumictl, pulumicli, go, schema-tools | ||
- name: Configure AWS Credentials | ||
uses: #{{ .Config.actionVersions.configureAwsCredentials }}# | ||
with: | ||
|
@@ -57,25 +50,44 @@ jobs: | |
role-external-id: upload-pulumi-release | ||
role-session-name: #{{ .Config.provider }}#@githubActions | ||
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} | ||
- name: Run GoReleaser | ||
- name: Create dist directory | ||
run: mkdir -p dist | ||
- name: Download provider assets | ||
uses: #{{ .Config.actionVersions.downloadArtifact }}# | ||
with: | ||
pattern: pulumi-resource-#{{ .Config.provider }}#-v${{ inputs.version }}-* | ||
path: dist | ||
# Don't create a directory for each artifact | ||
merge-multiple: true | ||
- name: Calculate checksums | ||
working-directory: dist | ||
run: shasum ./*.tar.gz > pulumi-#{{ .Config.provider }}#_${{ inputs.version }}_checksums.txt | ||
- name: Get Schema Change Summary | ||
id: schema-summary | ||
shell: bash | ||
run: | | ||
# Get latest stable release. Return only first column from result (tag). | ||
LAST_VERSION=$(gh release view --repo pulumi/pulumi-#{{ .Config.provider }}# --json tagName -q .tagName) | ||
{ | ||
echo 'summary<<EOF' | ||
schema-tools compare --provider="#{{ .Config.provider }}#" --old-commit="$LAST_VERSION" --new-commit="--local-path=provider/cmd/pulumi-resource-#{{ .Config.provider }}#/schema.json" | ||
echo 'EOF' | ||
} >> "$GITHUB_OUTPUT" | ||
- name: Upload Provider Binaries | ||
run: aws s3 cp dist s3://get.pulumi.com/releases/plugins/ --recursive | ||
- name: Create GH Release | ||
uses: softprops/action-gh-release@v1 | ||
if: inputs.isPrerelease == false | ||
uses: #{{ .Config.actionVersions.goReleaser }}# | ||
env: | ||
GORELEASER_CURRENT_TAG: v${{ inputs.version }} | ||
PROVIDER_VERSION: ${{ inputs.version }} | ||
with: | ||
args: -p #{{ .Config.parallel }}# release --rm-dist --timeout #{{ .Config.timeout }}#m0s | ||
version: latest | ||
- name: Run GoReleaser (prerelease) | ||
if: inputs.isPrerelease == true | ||
uses: #{{ .Config.actionVersions.goReleaser }}# | ||
tag_name: v${{ inputs.version }} | ||
prerelease: ${{ inputs.isPrerelease }} | ||
# We keep pre-releases as drafts so they're not visible until we manually publish them. | ||
draft: ${{ inputs.isPrerelease }} | ||
body: ${{ steps.schema-summary.outputs.summary }} | ||
generate_release_notes: true | ||
files: dist/* | ||
env: | ||
GORELEASER_CURRENT_TAG: v${{ inputs.version }} | ||
PROVIDER_VERSION: ${{ inputs.version }} | ||
with: | ||
args: -p #{{ .Config.parallel }}# -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout | ||
#{{ .Config.timeout }}#m0s | ||
version: latest | ||
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | ||
|
||
publish_sdk: | ||
name: publish_sdk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.