fix(pulumi) (#5087)

* fix(pulumi)

generate language specs

closes #5084

* stupid go

* use git for their scripts' sanity

* -buildmode=pie

* le sigh
This commit is contained in:
Jacob Heider 2024-02-01 14:58:29 -05:00 committed by GitHub
parent 53da7c209e
commit ac3cbfd6c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 21 deletions

View file

@ -84,7 +84,11 @@ jobs:
- name: wipe builds directory - name: wipe builds directory
run: | run: |
test -d builds test -d builds
rm -rf builds # requires `sudo` because `go` makes unremovable files...
if command -v sudo; then
SUDO=sudo
fi
$SUDO rm -rf builds
if: steps.build.outputs.pkgspec if: steps.build.outputs.pkgspec
- uses: pkgxdev/brewkit/test@v1 - uses: pkgxdev/brewkit/test@v1

View file

@ -1,6 +1,6 @@
distributable: distributable:
url: https://github.com/pulumi/pulumi/archive/refs/tags/v{{ version }}.tar.gz url: git+https://github.com/pulumi/pulumi.git
strip-components: 1 ref: ${{version.tag}}
versions: versions:
github: pulumi/pulumi github: pulumi/pulumi
@ -8,13 +8,27 @@ versions:
provides: provides:
- bin/pulumi - bin/pulumi
- bin/pulumi-analyzer-policy
- bin/pulumi-analyzer-policy-python
- bin/pulumi-language-dotnet
- bin/pulumi-language-go
- bin/pulumi-language-java
- bin/pulumi-language-nodejs
- bin/pulumi-language-python
- bin/pulumi-language-python-exec
- bin/pulumi-language-yaml
- bin/pulumi-resource-pulumi-nodejs
- bin/pulumi-resource-pulumi-python
- bin/pulumi-watch
dependencies: dependencies:
curl.se/ca-certs: '*' curl.se/ca-certs: '*'
build: build:
dependencies: dependencies:
go.dev: '*' go.dev: ^1.20
classic.yarnpkg.com: '*'
nodejs.org: '*'
script: script:
- run: go mod download - run: go mod download
working-directory: sdk working-directory: sdk
@ -23,31 +37,38 @@ build:
working-directory: pkg working-directory: pkg
- run: | - run: |
sed -i.bak -e 's/-ldflags "/-ldflags "-buildmode=pie /g' Makefile for DIR in go nodejs python; do
rm Makefile.bak make -C $DIR install_plugin PULUMI_BIN={{prefix}}/bin
if: linux done
working-directory: sdk
- make build # The next steps are modified from scripts/brew.sh
- make install - run: go build
-ldflags "$GO_LDFLAGS"
-o {{prefix}}/bin/pulumi ./cmd/pulumi
working-directory: pkg
- mkdir -p {{prefix}}/bin - ./scripts/prep-for-goreleaser.sh "local"
- mv build/bin/pulumi* {{prefix}}/bin/ - cp -a bin/$(go env GOOS)*/* {{prefix}}/bin/
# - mkdir -p {{prefix}}/bin
# - mv build/bin/pulumi* {{prefix}}/bin/
# Install shell completions # Install shell completions
# TODO: Doesn't work for zsh. Should it be left up to user? # TODO: Doesn't work for zsh. Should it be left up to user?
# {{prefix}}/bin/pulumi gen-completion $SHELL # {{prefix}}/bin/pulumi gen-completion $SHELL
env: env:
GOPATH: "$PWD/build" GOPATH: '$PWD/build'
GO_LDFLAGS:
- -X github.com/pulumi/pulumi/pkg/v3/version.Version={{version}}
linux:
GO_LDFLAGS:
- -buildmode=pie
test: test:
script: | script:
pulumi new aws-typescript --generate-only --force -y - pulumi new aws-typescript --generate-only --force -y
if [ -e "$PWD/Pulumi.yaml" ]; then - test -e Pulumi.yaml
echo "Project was created"
else
echo "Project was not created"
exit 1
fi
env: env:
PULUMI_ACCESS_TOKEN: local:// PULUMI_ACCESS_TOKEN: local://
PULUMI_TEMPLATE_PATH: "$PWD/templates" PULUMI_TEMPLATE_PATH: '$PWD/templates'