pulumi/scripts/make_release.ps1
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls (#3750)

* Switch away from native grpc impl. (#3728)

* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)

* Only retry as long as we get unavailable back.  Anything else continues. (#3769)

* Handle all errors for now. (#3781)


* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes (#4288)

Adjust C# generation

* Replace IDeployment with a sealed class (#4318)

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty (#4320)

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen (#4379)
2020-04-14 09:30:25 +01:00

55 lines
2.6 KiB
PowerShell

# make_release.ps1 will create a build package ready for publishing.
Set-StrictMode -Version 2.0
$ErrorActionPreference="Stop"
$Root=Join-Path $PSScriptRoot ".."
$PublishDir=New-Item -ItemType Directory -Path "$env:TEMP\$([System.IO.Path]::GetRandomFileName())"
$GitHash=$(git rev-parse HEAD)
$PublishFile="$(Split-Path -Parent -Path $PublishDir)\$GitHash.zip"
$Version = $( & "$PSScriptRoot\get-version.cmd")
$Branch = $(if (Test-Path env:APPVEYOR_REPO_BRANCH) { $env:APPVEYOR_REPO_BRANCH } else { $(git rev-parse --abbrev-ref HEAD) })
$PublishTargets = @($GitHash, $Version, $Branch)
function RunGoBuild($goPackage, $dir, $outputName) {
$binRoot = New-Item -ItemType Directory -Force -Path "$PublishDir\bin"
Push-Location $dir
go build -ldflags "-X github.com/pulumi/pulumi/pkg/v2/version.Version=$Version" -o "$binRoot\$outputName" $goPackage
Pop-Location
}
function CopyPackage($pathToModule, $moduleName) {
$moduleRoot = New-Item -ItemType Directory -Force -Path "$PublishDir\node_modules\$moduleName"
Copy-Item -Recurse $pathToModule\* $moduleRoot
if (Test-Path "$moduleRoot\node_modules") {
Remove-Item -Recurse -Force "$moduleRoot\node_modules"
}
if (Test-Path "$moduleRoot\tests") {
Remove-Item -Recurse -Force "$moduleRoot\tests"
}
}
RunGoBuild "github.com/pulumi/pulumi/pkg/v2/cmd/pulumi" "pkg" "pulumi.exe"
RunGoBuild "github.com/pulumi/pulumi/sdk/v2/nodejs/cmd/pulumi-language-nodejs" "sdk" "pulumi-language-nodejs.exe"
RunGoBuild "github.com/pulumi/pulumi/sdk/v2/python/cmd/pulumi-language-python" "sdk" "pulumi-language-python.exe"
RunGoBuild "github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet" "sdk" "pulumi-language-dotnet.exe"
RunGoBuild "github.com/pulumi/pulumi/sdk/v2/go/pulumi-language-go" "sdk" "pulumi-language-go.exe"
CopyPackage "$Root\sdk\nodejs\bin" "pulumi"
Copy-Item "$Root\sdk\nodejs\dist\pulumi-resource-pulumi-nodejs.cmd" "$PublishDir\bin"
Copy-Item "$Root\sdk\python\dist\pulumi-resource-pulumi-python.cmd" "$PublishDir\bin"
Copy-Item "$Root\sdk\nodejs\dist\pulumi-analyzer-policy.cmd" "$PublishDir\bin"
Copy-Item "$Root\sdk\python\dist\pulumi-analyzer-policy-python.cmd" "$PublishDir\bin"
Copy-Item "$Root\sdk\python\cmd\pulumi-language-python-exec" "$PublishDir\bin"
# By default, if the archive already exists, 7zip will just add files to it, so blow away the existing
# archive if it exists.
if (Test-Path $PublishFile) {
Remove-Item -Force $PublishFile
}
7z a "$PublishFile" "$PublishDir\." | Out-Null
Remove-Item -Recurse -Force $PublishDir
New-Object PSObject -Property @{ArchivePath=$PublishFile;Targets=$PublishTargets}