Publish SDK per build

After the move to stop including packages in the SDK, we no longer
published an SDK per build. This corrects this. Since the only things
in the SDK today are the language plugins and the CLI itself, we can
publish an SDK per build from pulumi/pulumi.

This change re-uses the existing infrastructure we have in
pulumi/sdk.

Fixes #1076
This commit is contained in:
Matt Ellis 2018-04-11 11:33:53 -07:00
parent 2c479c172d
commit 608af9349d
5 changed files with 18 additions and 4 deletions

View file

@ -46,6 +46,8 @@ install:
go get -u github.com/golang/dep/cmd/dep
git clone git@github.com:pulumi/home.git "%USERPROFILE%\go\src\github.com\pulumi\home"
git clone git@github.com:pulumi/sdk.git "%USERPROFILE%\go\src\github.com\pulumi\sdk"
build_script:
- cmd: >-
if defined APPVEYOR_PULL_REQUEST_NUMBER ( msbuild /t:AppVeyorPullRequest /v:Detailed build.proj ) else ( msbuild /t:AppVeyorPush /v:Detailed build.proj )

View file

@ -4,6 +4,7 @@
# we can in a subshell.
export PULUMI_HOME="$(go env GOPATH)/src/github.com/pulumi/home"
export PULUMI_SDK="$(go env GOPATH)/src/github.com/pulumi/home"
(
set -o nounset -o errexit -o pipefail
@ -16,6 +17,9 @@ export PULUMI_HOME="$(go env GOPATH)/src/github.com/pulumi/home"
# We have some shared scripts in pulumi/home, and we use them in other steps
git clone git@github.com:pulumi/home "${PULUMI_HOME}"
# We have some shared scripts in pulumi/sdk, and we use them in other steps
git clone git@github.com:pulumi/sdk "${PULUMI_SDK}"
# If we have an NPM token, put it in the .npmrc file, so we can use it:
if [ ! -z "${NPM_TOKEN:-}" ]; then
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc

View file

@ -10,10 +10,11 @@ if ($LASTEXITCODE -ne 0) {
}
try {
git describe --tags --exact-match 2>$null
git describe --tags --exact-match >$null 2>$null
# If we get here the above did not throw, so we can use the exact tag
Write-Host "$(git describe --tags --exact-match)$dirtyTag"
Write-Output "$(git describe --tags --exact-match)$dirtyTag"
} catch {
# Otherwise, append the timestamp of the commit and the hash
Write-Host "$(git describe --tags --abbrev=0)-$(git show -s --format='%ct-g%h')$dirtyTag"
}
Write-Output "$(git describe --tags --abbrev=0)-$(git show -s --format='%ct-g%h')$dirtyTag"
}

View file

@ -3,6 +3,8 @@ Set-StrictMode -Version 2.0
$ErrorActionPreference="Stop"
$PublishScript="$(go env GOPATH)\src\github.com\pulumi\home\scripts\publish.ps1"
$BuildSdkScript="$(go env GOPATH)\src\github.com\pulumi\sdk\scripts\build-sdk.ps1"
if (!(Test-Path $PublishScript)) {
Write-Error "Missing publish script at $PublishScript"
@ -14,3 +16,6 @@ $PublishTargets=${ReleaseInfo}.Targets
& $PublishScript $ReleaseInfo.ArchivePath "pulumi/windows/amd64" @PublishTargets
Remove-Item -Force $ReleaseInfo.ArchivePath
$Version=& $PSScriptRoot\get-version.ps1
& $BuildSdkScript $Version $(get rev-parse HEAD)

View file

@ -25,3 +25,5 @@ if [[ "${TRAVIS_OS_NAME:-}" == "linux" ]]; then
-u pulumi -p pulumi \
${ROOT}/sdk/python/env/src/dist/*.whl
fi
${PULUMI_SDK}/scripts/build-sdk.sh $(${ROOT}/scripts/get-version) $(git rev-parse HEAD)