Skip to content

Makefile migration: make build_sdk #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
with:
pulumi-version: dev
- name: Build Pulumi SDK
run: dotnet run build-sdk
run: make build_sdk
- name: Workspace clean (are xml doc file updates committed?)
uses: pulumi/git-status-check-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
with:
pulumi-version: dev
- name: Build Pulumi SDK
run: dotnet run build-sdk
run: make build_sdk
- name: Test Pulumi SDK
run: dotnet run test-sdk
- name: Test Pulumi Automation SDK
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ GO := go
# Try to get the dev version using changie, otherwise fall back
FALLBACK_DEV_VERSION := 3.0.0-dev.0
DEV_VERSION := $(shell if command -v changie > /dev/null; then changie next patch -p dev.0; else echo "$(FALLBACK_DEV_VERSION)"; fi)
SDK_VERSION := $(shell cd pulumi-language-dotnet && sed -n 's/^.*github\.com\/pulumi\/pulumi\/sdk\/v3 v//p' go.mod)

install::
cd pulumi-language-dotnet && ${GO} install \
-ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/version.Version=$(DEV_VERSION)" ./...

build::
build: clean build_sdk build_language_host

build_sdk:
cd sdk && dotnet restore --no-cache
cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION)

build_language_host:
cd pulumi-language-dotnet && ${GO} build \
-ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/version.Version=$(DEV_VERSION)" .

Expand Down Expand Up @@ -38,4 +45,4 @@ lint::
--path-prefix $(pkg)) \
&&) true

.PHONY: install build clean
.PHONY: install build build_language_host build_sdk clean
14 changes: 5 additions & 9 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,11 @@ let listIntegrationTests() =
printfn $"{testName}"

let buildSdk() =
cleanSdk()
restoreSdk()
match findGoSDKVersion(pulumiLanguageDotnet) with
| None -> failwith "Could not find the Pulumi SDK version in go.mod"
| Some(version) ->
printfn "Building Pulumi SDK"
if Shell.Exec("dotnet", "build --configuration Release -p:PulumiSdkVersion=" + version, sdk) <> 0

then failwith "build failed"
printfn "Deprecated: calling `make build_sdk` instead"
let cmd = Cli.Wrap("make").WithArguments("build_sdk").WithWorkingDirectory(repositoryRoot)
let output = cmd.ExecuteBufferedAsync().GetAwaiter().GetResult()
if output.ExitCode <> 0 then
failwith "Build failed"

/// Publishes packages for Pulumi, Pulumi.Automation and Pulumi.FSharp to nuget.
/// Requires NUGET_PUBLISH_KEY and PULUMI_VERSION environment variables.
Expand Down
Loading