Skip to content

Commit 640b942

Browse files
committed
Initial commit
1 parent 2c4d366 commit 640b942

File tree

31 files changed

+2134
-2
lines changed

31 files changed

+2134
-2
lines changed

.github/workflows/manual.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
workflow_dispatch:
3+
4+
env:
5+
GOPRIVATE: "github.com/cloudy-sky-software/*"
6+
PROVIDER: "render"
7+
8+
jobs:
9+
publish-binary:
10+
name: Publish binary
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v3
15+
16+
- run: |
17+
git config --local url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
18+
env:
19+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
20+
21+
- name: Unshallow clone for tags
22+
run: git fetch --prune --unshallow --tags
23+
24+
- name: Install Go
25+
uses: actions/setup-go@v3
26+
with:
27+
go-version: ${{matrix.goversion}}
28+
29+
- name: Install pulumictl
30+
uses: jaxxstorm/action-install-gh-release@v1.7.1
31+
with:
32+
repo: pulumi/pulumictl
33+
tag: "latest"
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Run GoReleaser
38+
uses: goreleaser/goreleaser-action@v3
39+
with:
40+
args: -p 1 release --rm-dist --timeout 90m0s
41+
version: latest
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Upload artifacts
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: dist
49+
path: dist/**/*
50+
strategy:
51+
fail-fast: true
52+
matrix:
53+
goversion:
54+
- 1.19.x

.github/workflows/push.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
pull_request:
7+
branches:
8+
- main
9+
10+
env:
11+
GOLANG_CI_LINT_VERSION: v1.50.0
12+
GOPRIVATE: "github.com/cloudy-sky-software/*"
13+
PROVIDER: "render"
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v3
21+
22+
- name: Unshallow clone for tags
23+
run: git fetch --prune --unshallow --tags
24+
25+
- name: Install Go
26+
uses: actions/setup-go@v3
27+
with:
28+
go-version: 1.19.x
29+
30+
- run: |
31+
git config --global url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
32+
env:
33+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
34+
35+
- name: Lint
36+
run: |
37+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANG_CI_LINT_VERSION
38+
make lint
39+
40+
- name: Test
41+
run: make test
42+
43+
assert-clean-tree:
44+
name: Check if working tree is clean
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout Repo
48+
uses: actions/checkout@v3
49+
50+
- run: |
51+
git config --global url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
52+
env:
53+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
54+
55+
- name: Unshallow clone for tags
56+
run: git fetch --prune --unshallow --tags
57+
58+
- name: Install Go
59+
uses: actions/setup-go@v3
60+
with:
61+
go-version: 1.19.x
62+
63+
- name: Setup Node
64+
uses: actions/setup-node@v3
65+
with:
66+
node-version: 16.x
67+
68+
- name: Setup DotNet
69+
uses: actions/setup-dotnet@v3
70+
with:
71+
dotnet-version: 3.1.301
72+
73+
- name: Setup Python
74+
uses: actions/setup-python@v4
75+
with:
76+
python-version: 3.9
77+
78+
- name: Install pulumictl
79+
uses: jaxxstorm/action-install-gh-release@v1.7.1
80+
with:
81+
repo: pulumi/pulumictl
82+
tag: "latest"
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Generate schema and build SDKs
87+
run: make gen generate_schema build
88+
89+
- name: Check worktree clean
90+
run: |
91+
git update-index -q --refresh
92+
if ! git diff-files --quiet; then
93+
>&2 echo "error: working tree is not clean, aborting!"
94+
git status
95+
git diff
96+
exit 1
97+
fi

.github/workflows/release.yml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
- "!v*.*.*-**"
7+
env:
8+
GOLANG_CI_LINT_VERSION: v1.50.0
9+
GOPRIVATE: "github.com/cloudy-sky-software/*"
10+
PROVIDER: "render"
11+
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
12+
PUBLISH_NPM: true
13+
NPM_REGISTRY_URL: https://registry.npmjs.org
14+
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_API_KEY }}
15+
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
16+
PUBLISH_NUGET: true
17+
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
18+
# PYPI usernames for API tokens is literally __token__.
19+
PYPI_USERNAME: "__token__"
20+
PUBLISH_PYPI: true
21+
22+
jobs:
23+
lint:
24+
name: Lint
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v3
29+
30+
- name: Install Go
31+
uses: actions/setup-go@v3
32+
with:
33+
go-version: 1.19.x
34+
35+
- run: |
36+
git config --global url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
37+
env:
38+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
39+
40+
- name: Lint
41+
run: |
42+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANG_CI_LINT_VERSION
43+
make lint
44+
45+
- name: Test
46+
run: make test
47+
48+
publish-binary:
49+
name: Publish binary
50+
runs-on: ${{ matrix.agent-os }}
51+
needs: lint
52+
steps:
53+
- name: Checkout Repo
54+
uses: actions/checkout@v3
55+
56+
- run: |
57+
git config --global url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
58+
env:
59+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
60+
61+
- name: Unshallow clone for tags
62+
run: git fetch --prune --unshallow --tags
63+
64+
- name: Install Go
65+
uses: actions/setup-go@v3
66+
with:
67+
go-version: 1.19.x
68+
69+
- name: Install pulumictl
70+
uses: jaxxstorm/action-install-gh-release@v1.7.1
71+
with:
72+
repo: pulumi/pulumictl
73+
tag: "latest"
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Run GoReleaser
78+
uses: goreleaser/goreleaser-action@v3
79+
with:
80+
args: -f ${{ matrix.goreleaser }} -p 1 release --rm-dist --timeout 90m0s
81+
version: latest
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
strategy:
85+
fail-fast: true
86+
matrix:
87+
agent-os:
88+
- ubuntu-latest
89+
- macos-latest
90+
include:
91+
- agent-os: ubuntu-latest
92+
goreleaser: .goreleaser.yml
93+
- agent-os: macos-latest
94+
goreleaser: .goreleaser.darwin.yml
95+
96+
publish-sdk:
97+
name: Publish SDKs
98+
runs-on: ubuntu-latest
99+
needs: publish-binary
100+
steps:
101+
- name: Checkout Repo
102+
uses: actions/checkout@v3
103+
104+
- run: |
105+
git config --global url."https://praneetloke:${GH_REPO_PAT}@github.com/".insteadOf "https://github.com/"
106+
env:
107+
GH_REPO_PAT: ${{ secrets.GH_REPO_PAT }}
108+
109+
- name: Unshallow clone for tags
110+
run: git fetch --prune --unshallow --tags
111+
112+
- name: Install Go
113+
uses: actions/setup-go@v3
114+
with:
115+
go-version: ${{ matrix.goversion }}
116+
117+
- name: Install pulumictl
118+
uses: jaxxstorm/action-install-gh-release@v1.7.1
119+
with:
120+
repo: pulumi/pulumictl
121+
tag: "latest"
122+
env:
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
125+
- name: Install Pulumi CLI
126+
uses: pulumi/action-install-pulumi-cli@v2.0.0
127+
128+
- name: Setup Node
129+
uses: actions/setup-node@v3
130+
with:
131+
node-version: ${{matrix.nodeversion}}
132+
registry-url: ${{env.NPM_REGISTRY_URL}}
133+
134+
- name: Setup DotNet
135+
uses: actions/setup-dotnet@v3
136+
with:
137+
dotnet-version: ${{matrix.dotnetverson}}
138+
139+
- name: Setup Python
140+
uses: actions/setup-python@v4
141+
with:
142+
python-version: ${{matrix.pythonversion}}
143+
144+
- name: Generate SDK
145+
run: make gen ${{ matrix.language }}_sdk
146+
147+
- name: Check worktree clean
148+
run: |
149+
git update-index -q --refresh
150+
if ! git diff-files --quiet; then
151+
>&2 echo "error: working tree is not clean, aborting!"
152+
git status
153+
git diff
154+
exit 1
155+
fi
156+
157+
- name: Compress SDK folder
158+
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
159+
160+
- name: Upload artifacts
161+
uses: actions/upload-artifact@v3
162+
with:
163+
name: ${{ matrix.language }}-sdk.tar.gz
164+
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
165+
166+
- if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
167+
name: Publish package to PyPI
168+
uses: pypa/gh-action-pypi-publish@release/v1
169+
with:
170+
user: ${{ env.PYPI_USERNAME }}
171+
password: ${{ env.PYPI_PASSWORD }}
172+
packages_dir: ${{github.workspace}}/sdk/python/bin/dist
173+
174+
- if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }}
175+
uses: JS-DevTools/npm-publish@v1
176+
with:
177+
access: "public"
178+
token: ${{ env.NPM_TOKEN }}
179+
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
180+
181+
- if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
182+
name: publish nuget package
183+
run: |
184+
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }}
185+
echo "done publishing packages"
186+
strategy:
187+
fail-fast: true
188+
matrix:
189+
dotnetversion:
190+
- 3.1.301
191+
goversion:
192+
- 1.19.x
193+
language:
194+
- nodejs
195+
- python
196+
- dotnet
197+
- go
198+
nodeversion:
199+
- 16.x
200+
pythonversion:
201+
- "3.9"

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**/.DS_Store
2+
3+
/vendor/
4+
/.idea/
5+
/nuget/
6+
**/bin/
7+
**/obj/
8+
**/node_modules/
9+
yarn.lock
10+
11+
.pulumi
12+
Pulumi.*.yaml
13+
14+
/sdk/dotnet/version.txt
15+
**/dist

.golangci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
run:
2+
skip-files:
3+
- pulumi-resource-xyz/schema.go
4+
# Ignore the generated config.go file temporarily because it contains
5+
# an unused import that the linter will complain about.
6+
- go/xyz/config/config.go
7+
8+
linters:
9+
enable-all: false
10+
enable:
11+
- errcheck
12+
- goconst
13+
- gofmt
14+
- gosec
15+
- govet
16+
- ineffassign
17+
- misspell
18+
- nakedret
19+
- revive
20+
- unconvert
21+
- unused
22+
disable:
23+
- lll
24+
- staticcheck
25+
- megacheck

0 commit comments

Comments
 (0)