Skip to content

Commit 57c49b0

Browse files
authored
[internal] Update GitHub Actions workflow files (#298)
1 parent 776a009 commit 57c49b0

File tree

8 files changed

+232
-49
lines changed

8 files changed

+232
-49
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ jobs:
180180
with:
181181
path: ci-scripts
182182
repository: pulumi/scripts
183+
- name: Mark repo as safe directory
184+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
185+
}}/pulumi-${{ env.PROVIDER }}
183186
- name: Unshallow clone for tags
184187
run: git fetch --prune --unshallow --tags
185188
- name: Install Go
@@ -213,6 +216,9 @@ jobs:
213216
with:
214217
path: ci-scripts
215218
repository: pulumi/scripts
219+
- name: Mark repo as safe directory
220+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
221+
}}/pulumi-${{ env.PROVIDER }}
216222
- name: Unshallow clone for tags
217223
run: git fetch --prune --unshallow --tags
218224
- name: Install Go

.github/workflows/master.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ jobs:
180180
with:
181181
path: ci-scripts
182182
repository: pulumi/scripts
183+
- name: Mark repo as safe directory
184+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
185+
}}/pulumi-${{ env.PROVIDER }}
183186
- name: Unshallow clone for tags
184187
run: git fetch --prune --unshallow --tags
185188
- name: Install Go
@@ -213,6 +216,9 @@ jobs:
213216
with:
214217
path: ci-scripts
215218
repository: pulumi/scripts
219+
- name: Mark repo as safe directory
220+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
221+
}}/pulumi-${{ env.PROVIDER }}
216222
- name: Unshallow clone for tags
217223
run: git fetch --prune --unshallow --tags
218224
- name: Install Go

.github/workflows/prerelease.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ jobs:
130130
with:
131131
path: ci-scripts
132132
repository: pulumi/scripts
133+
- name: Mark repo as safe directory
134+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
135+
}}/pulumi-${{ env.PROVIDER }}
133136
- name: Unshallow clone for tags
134137
run: git fetch --prune --unshallow --tags
135138
- name: Install Go
@@ -163,6 +166,9 @@ jobs:
163166
with:
164167
path: ci-scripts
165168
repository: pulumi/scripts
169+
- name: Mark repo as safe directory
170+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
171+
}}/pulumi-${{ env.PROVIDER }}
166172
- name: Unshallow clone for tags
167173
run: git fetch --prune --unshallow --tags
168174
- name: Install Go

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ jobs:
143143
with:
144144
path: ci-scripts
145145
repository: pulumi/scripts
146+
- name: Mark repo as safe directory
147+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
148+
}}/pulumi-${{ env.PROVIDER }}
146149
- name: Unshallow clone for tags
147150
run: git fetch --prune --unshallow --tags
148151
- name: Install Go
@@ -176,6 +179,9 @@ jobs:
176179
with:
177180
path: ci-scripts
178181
repository: pulumi/scripts
182+
- name: Mark repo as safe directory
183+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
184+
}}/pulumi-${{ env.PROVIDER }}
179185
- name: Unshallow clone for tags
180186
run: git fetch --prune --unshallow --tags
181187
- name: Install Go

.github/workflows/run-acceptance-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ jobs:
154154
with:
155155
path: ci-scripts
156156
repository: pulumi/scripts
157+
- name: Mark repo as safe directory
158+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
159+
}}/pulumi-${{ env.PROVIDER }}
157160
- name: Unshallow clone for tags
158161
run: git fetch --prune --unshallow --tags
159162
- name: Install Go
@@ -191,6 +194,9 @@ jobs:
191194
with:
192195
path: ci-scripts
193196
repository: pulumi/scripts
197+
- name: Mark repo as safe directory
198+
run: git config --global --add safe.directory /__w/pulumi-${{ env.PROVIDER
199+
}}/pulumi-${{ env.PROVIDER }}
194200
- name: Unshallow clone for tags
195201
run: git fetch --prune --unshallow --tags
196202
- name: Install Go

Makefile

Lines changed: 66 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,38 @@ build: install_plugins provider build_sdks install_sdks
1919

2020
build_sdks: build_nodejs build_python build_go build_dotnet build_java
2121

22-
install_go_sdk:
22+
install_go_sdk:
2323

24-
install_java_sdk:
24+
install_java_sdk:
2525

26-
install_python_sdk:
26+
install_python_sdk:
2727

2828
install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk
2929

3030
only_build: build
3131

3232
build_dotnet: DOTNET_VERSION := $(shell pulumictl get version --language dotnet)
33-
build_dotnet:
33+
build_dotnet: upstream
3434
pulumictl get version --language dotnet
3535
$(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/
3636
cd sdk/dotnet/ && \
3737
echo "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
3838
echo "$(DOTNET_VERSION)" >version.txt && \
3939
dotnet build /p:Version=$(DOTNET_VERSION)
4040

41-
build_go:
41+
build_go: upstream
4242
$(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
4343
cd sdk && go list `grep -e "^module" go.mod | cut -d ' ' -f 2`/go/... | xargs go build
4444

4545
build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic)
46-
build_java: bin/pulumi-java-gen
46+
build_java: bin/pulumi-java-gen upstream
4747
$(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus
4848
cd sdk/java/ && \
4949
echo "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
5050
gradle --console=plain build
5151

5252
build_nodejs: VERSION := $(shell pulumictl get version --language javascript)
53-
build_nodejs:
53+
build_nodejs: upstream
5454
$(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/
5555
cd sdk/nodejs/ && \
5656
echo "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
@@ -60,7 +60,7 @@ build_nodejs:
6060
sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json
6161

6262
build_python: PYPI_VERSION := $(shell pulumictl get version --language python)
63-
build_python:
63+
build_python: upstream
6464
$(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/
6565
cd sdk/python/ && \
6666
echo "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
@@ -71,43 +71,90 @@ build_python:
7171
rm ./bin/setup.py.bak && rm ./bin/go.mod && \
7272
cd ./bin && python3 setup.py build sdist
7373

74-
clean:
74+
clean:
7575
rm -rf sdk/{dotnet,nodejs,go,python}
7676

77-
cleanup:
77+
cleanup:
7878
rm -r $(WORKING_DIR)/bin
7979
rm -f provider/cmd/$(PROVIDER)/schema.go
8080

81-
help:
81+
finish-patch:
82+
@if [ ! -z "$$(cd upstream && git status --porcelain)" ]; then echo "Please commit your changes before finishing the patch"; exit 1; fi
83+
@cd upstream && \
84+
git format-patch HEAD~ -o ../patches --start-number $$(($$(ls ../patches | wc -l | xargs)+1))
85+
86+
help:
8287
@grep '^[^.#]\+:\s\+.*#' Makefile | \
8388
sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \
8489
expand -t20
8590

86-
install_dotnet_sdk:
91+
install_dotnet_sdk:
8792
mkdir -p $(WORKING_DIR)/nuget
8893
find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \;
8994

90-
install_nodejs_sdk:
95+
install_nodejs_sdk:
9196
yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin
9297

93-
install_plugins:
94-
[ -x $(shell which pulumi) ] || curl -fsSL https://get.pulumi.com | sh
98+
install_plugins:
99+
[ -x "$(shell command -v pulumi)" ] || curl -fsSL https://get.pulumi.com | sh
95100

96101
lint_provider: provider
97102
cd provider && golangci-lint run -c ../.golangci.yml
98103

99104
provider: tfgen install_plugins
100105
(cd provider && go build -p 1 -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER))
101106

102-
test:
107+
start-patch: upstream
108+
ifeq ("$(wildcard upstream)","")
109+
@echo "No upstream found, so upstream can't be patched"
110+
@exit 1
111+
else
112+
# To add an additional patch:
113+
#
114+
# 1. Run this command (`make start-patch`).
115+
#
116+
# 2. Edit the `upstream` repo, making whatever changes you want to appear in the new
117+
# patch. It's fine to edit multiple files.
118+
#
119+
# 3. Commit your changes. The slugified first line of your commit description will
120+
# be used to generate the patch file name. Only the diff from the latest commit will
121+
# end up in the final patch.
122+
#
123+
# 4. Run `make finish-patch`.
124+
#
125+
# It is safe to run `make start-patch` as many times as you want, but any changes
126+
# might be reverted until `make finish-patch` is run.
127+
@cd upstream && git commit --quiet -m "existing patches"
128+
endif
129+
130+
test:
103131
cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h
104132

105-
tfgen: install_plugins
133+
tfgen: install_plugins upstream
106134
(cd provider && go build -p 1 -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN))
107135
$(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER)
108136
(cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go)
109137

110-
bin/pulumi-java-gen:
138+
upstream:
139+
ifeq ("$(wildcard upstream)","")
140+
# upstream doesn't exist, so skip
141+
else ifeq ("$(wildcard patches/*.patch)","")
142+
# upstream exists, but patches don't exist. This is probably an error.
143+
@echo "No patches found within the patch operation"
144+
@echo "patches were expected because upstream exists"
145+
@exit 1
146+
else
147+
# Checkout the submodule at the pinned commit.
148+
# `--force`: If the submodule is at a different commit, move it to the pinned commit.
149+
# `--init`: If the submodule is not initialized, initialize it.
150+
git submodule update --force --init
151+
# Iterating over the patches folder in sorted order,
152+
# apply the patch using a 3-way merge strategy. This mirrors the default behavior of `git merge`
153+
cd upstream && \
154+
for patch in $(sort $(wildcard patches/*.patch)); do git apply --3way ../$$patch || exit 1; done
155+
endif
156+
157+
bin/pulumi-java-gen:
111158
$(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java)
112159

113-
.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen
160+
.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup finish-patch help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider start-patch test tfgen upstream

examples/go.mod

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,138 @@
11
module github.com/pulumi/pulumi-github/examples/v4
22

3-
go 1.16
3+
go 1.19
44

55
require github.com/pulumi/pulumi/pkg/v3 v3.19.0
6+
7+
require (
8+
cloud.google.com/go v0.81.0 // indirect
9+
cloud.google.com/go/logging v1.0.0 // indirect
10+
cloud.google.com/go/storage v1.15.0 // indirect
11+
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
12+
github.com/Azure/azure-sdk-for-go v54.0.0+incompatible // indirect
13+
github.com/Azure/azure-storage-blob-go v0.13.0 // indirect
14+
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
15+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
16+
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
17+
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
18+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.7 // indirect
19+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect
20+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
21+
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
22+
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
23+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
24+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
25+
github.com/agext/levenshtein v1.2.1 // indirect
26+
github.com/apparentlymart/go-textseg v1.0.0 // indirect
27+
github.com/aws/aws-sdk-go v1.38.35 // indirect
28+
github.com/blang/semver v3.5.1+incompatible // indirect
29+
github.com/cheggaaa/pb v1.0.18 // indirect
30+
github.com/davecgh/go-spew v1.1.1 // indirect
31+
github.com/dimchansky/utfbom v1.1.1 // indirect
32+
github.com/djherbis/times v1.2.0 // indirect
33+
github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182 // indirect
34+
github.com/dustin/go-humanize v1.0.0 // indirect
35+
github.com/emirpasic/gods v1.12.0 // indirect
36+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
37+
github.com/gofrs/flock v0.7.1 // indirect
38+
github.com/gofrs/uuid v3.3.0+incompatible // indirect
39+
github.com/gogo/protobuf v1.3.1 // indirect
40+
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
41+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
42+
github.com/golang/protobuf v1.5.2 // indirect
43+
github.com/golang/snappy v0.0.3 // indirect
44+
github.com/google/go-cmp v0.5.5 // indirect
45+
github.com/google/go-querystring v1.0.0 // indirect
46+
github.com/google/uuid v1.2.0 // indirect
47+
github.com/google/wire v0.5.0 // indirect
48+
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
49+
github.com/gorilla/mux v1.7.4 // indirect
50+
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
51+
github.com/hashicorp/errwrap v1.1.0 // indirect
52+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
53+
github.com/hashicorp/go-multierror v1.1.1 // indirect
54+
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
55+
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
56+
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
57+
github.com/hashicorp/hcl v1.0.0 // indirect
58+
github.com/hashicorp/hcl/v2 v2.3.0 // indirect
59+
github.com/hashicorp/vault/api v1.1.0 // indirect
60+
github.com/hashicorp/vault/sdk v0.2.0 // indirect
61+
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd // indirect
62+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
63+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
64+
github.com/jmespath/go-jmespath v0.4.0 // indirect
65+
github.com/json-iterator/go v1.1.9 // indirect
66+
github.com/jstemmer/go-junit-report v0.9.1 // indirect
67+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
68+
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
69+
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
70+
github.com/mattn/go-colorable v0.1.6 // indirect
71+
github.com/mattn/go-ieproxy v0.0.1 // indirect
72+
github.com/mattn/go-isatty v0.0.12 // indirect
73+
github.com/mattn/go-runewidth v0.0.8 // indirect
74+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
75+
github.com/mitchellh/go-homedir v1.1.0 // indirect
76+
github.com/mitchellh/go-ps v1.0.0 // indirect
77+
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
78+
github.com/mitchellh/mapstructure v1.4.1 // indirect
79+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
80+
github.com/modern-go/reflect2 v1.0.1 // indirect
81+
github.com/opentracing/basictracer-go v1.0.0 // indirect
82+
github.com/opentracing/opentracing-go v1.1.0 // indirect
83+
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 // indirect
84+
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
85+
github.com/pkg/errors v0.9.1 // indirect
86+
github.com/pmezard/go-difflib v1.0.0 // indirect
87+
github.com/pulumi/pulumi/sdk/v3 v3.19.0 // indirect
88+
github.com/rivo/uniseg v0.2.0 // indirect
89+
github.com/rjeczalik/notify v0.9.2 // indirect
90+
github.com/rogpeppe/go-internal v1.9.0 // indirect
91+
github.com/ryanuber/go-glob v1.0.0 // indirect
92+
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 // indirect
93+
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
94+
github.com/sergi/go-diff v1.1.0 // indirect
95+
github.com/sirupsen/logrus v1.4.2 // indirect
96+
github.com/spf13/cobra v1.0.0 // indirect
97+
github.com/spf13/pflag v1.0.3 // indirect
98+
github.com/src-d/gcfg v1.4.0 // indirect
99+
github.com/stretchr/testify v1.6.1 // indirect
100+
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6 // indirect
101+
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
102+
github.com/uber/jaeger-client-go v2.22.1+incompatible // indirect
103+
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
104+
github.com/xanzy/ssh-agent v0.2.1 // indirect
105+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
106+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
107+
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
108+
github.com/zclconf/go-cty v1.3.1 // indirect
109+
go.opencensus.io v0.23.0 // indirect
110+
go.uber.org/atomic v1.7.0 // indirect
111+
gocloud.dev v0.23.0 // indirect
112+
gocloud.dev/secrets/hashivault v0.23.0 // indirect
113+
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf // indirect
114+
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
115+
golang.org/x/mod v0.4.2 // indirect
116+
golang.org/x/net v0.0.0-20210505214959-0714010a04ed // indirect
117+
golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c // indirect
118+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
119+
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect
120+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
121+
golang.org/x/text v0.3.6 // indirect
122+
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
123+
golang.org/x/tools v0.1.0 // indirect
124+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
125+
google.golang.org/api v0.46.0 // indirect
126+
google.golang.org/appengine v1.6.7 // indirect
127+
google.golang.org/genproto v0.0.0-20210506142907-4a47615972c2 // indirect
128+
google.golang.org/grpc v1.37.0 // indirect
129+
google.golang.org/protobuf v1.26.0 // indirect
130+
gopkg.in/AlecAivazis/survey.v1 v1.8.9-0.20200217094205-6773bdf39b7f // indirect
131+
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
132+
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
133+
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
134+
gopkg.in/warnings.v0 v0.1.2 // indirect
135+
gopkg.in/yaml.v2 v2.2.8 // indirect
136+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
137+
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect
138+
)

0 commit comments

Comments
 (0)