Skip to content

Commit f65f92b

Browse files
authored
Merge pull request #4 from tencentcloudstack/define-sdks
Define sdks
2 parents 6cfcfd9 + 52fa549 commit f65f92b

File tree

2,126 files changed

+4953
-3473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,126 files changed

+4953
-3473
lines changed

.github/workflows/release.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
- v*.*.*-**
7+
env:
8+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
10+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11+
PUBLISH_NPM: true
12+
NPM_REGISTRY_URL: https://registry.npmjs.org
13+
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
14+
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
15+
PUBLISH_NUGET: false # not support nuget because of the account reason.
16+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
17+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
18+
PYPI_REPOSITORY_URL: ""
19+
PUBLISH_PYPI: true
20+
jobs:
21+
publish_binary:
22+
name: publish
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Repo
26+
uses: actions/checkout@v2
27+
- name: Unshallow clone for tags
28+
run: git fetch --prune --unshallow --tags
29+
- name: Install Go
30+
uses: actions/setup-go@v2
31+
with:
32+
go-version: ${{matrix.goversion}}
33+
- name: Install pulumictl
34+
uses: jaxxstorm/action-install-gh-release@v1.5.0
35+
with:
36+
repo: pulumi/pulumictl
37+
- name: Set PreRelease Version
38+
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
39+
- name: Run GoReleaser
40+
uses: goreleaser/goreleaser-action@v2
41+
with:
42+
args: -p 3 release --rm-dist
43+
version: latest
44+
strategy:
45+
fail-fast: true
46+
matrix:
47+
goversion:
48+
- 1.18.x
49+
publish_sdk:
50+
name: Publish SDKs
51+
runs-on: ubuntu-latest
52+
needs: publish_binary
53+
steps:
54+
- name: Checkout Repo
55+
uses: actions/checkout@v2
56+
- name: Unshallow clone for tags
57+
run: git fetch --prune --unshallow --tags
58+
- name: Install Go
59+
uses: actions/setup-go@v2
60+
with:
61+
go-version: ${{ matrix.goversion }}
62+
- name: Install pulumictl
63+
uses: jaxxstorm/action-install-gh-release@v1.5.0
64+
with:
65+
repo: pulumi/pulumictl
66+
- name: Install Pulumi CLI
67+
uses: pulumi/action-install-pulumi-cli@v2.0.0
68+
- name: Setup Node
69+
uses: actions/setup-node@v1
70+
with:
71+
node-version: ${{matrix.nodeversion}}
72+
registry-url: ${{env.NPM_REGISTRY_URL}}
73+
- name: Setup DotNet
74+
uses: actions/setup-dotnet@v1
75+
with:
76+
dotnet-version: ${{matrix.dotnetverson}}
77+
- name: Setup Python
78+
uses: actions/setup-python@v1
79+
with:
80+
python-version: ${{matrix.pythonversion}}
81+
- name: Build SDK
82+
run: make build_${{ matrix.language }}_sdk
83+
- name: Check worktree clean
84+
run: |
85+
git update-index -q --refresh
86+
if ! git diff-files --quiet; then
87+
>&2 echo "error: working tree is not clean, aborting!"
88+
git status
89+
git diff
90+
exit 1
91+
fi
92+
- if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
93+
name: Publish package to PyPI
94+
uses: pypa/gh-action-pypi-publish@release/v1
95+
with:
96+
user: ${{ env.PYPI_USERNAME }}
97+
password: ${{ env.PYPI_PASSWORD }}
98+
packages_dir: ${{github.workspace}}/sdk/python/bin/dist
99+
- if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }}
100+
uses: JS-DevTools/npm-publish@v1
101+
with:
102+
access: "public"
103+
token: ${{ env.NPM_TOKEN }}
104+
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
105+
- if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
106+
name: publish nuget package
107+
run: |
108+
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }}
109+
echo "done publishing packages"
110+
strategy:
111+
fail-fast: true
112+
matrix:
113+
dotnetversion:
114+
- 3.1.301
115+
goversion:
116+
- 1.18.x
117+
language:
118+
- nodejs
119+
- python
120+
- dotnet
121+
- go
122+
nodeversion:
123+
- 14.x
124+
pythonversion:
125+
- "3.9"

.goreleaser.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
archives:
2+
- id: archive
3+
name_template: '{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
4+
before:
5+
hooks:
6+
- make tfgen
7+
builds:
8+
- binary: provider-resource-tencentcloud
9+
dir: provider
10+
env:
11+
- CGO_ENABLED=0
12+
goarch:
13+
- amd64
14+
- arm64
15+
goos:
16+
- darwin
17+
- windows
18+
- linux
19+
ldflags:
20+
# The line below MUST align with the module in current provider/go.mod
21+
- -X github.com/tencentcloudstack/pulumi-tencentcloud/provider/pkg/version.Version={{.Tag }}
22+
main: ./cmd/pulumi-resource-tencentcloud/
23+
changelog:
24+
skip: true
25+
release:
26+
disable: false
27+
prerelease: auto
28+
snapshot:
29+
name_template: '{{ .Tag }}-SNAPSHOT'

0 commit comments

Comments
 (0)