Skip to content

Commit 22ceafe

Browse files
authored
Merge pull request #4 from pulumiverse/feature/build-and-publish-provider
Feature/build and publish provider
2 parents 0af3a21 + d4db67d commit 22ceafe

File tree

11 files changed

+406
-224
lines changed

11 files changed

+406
-224
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: main
2+
3+
on:
4+
push:
5+
# branches:
6+
# - main
7+
workflow_dispatch:
8+
9+
jobs:
10+
prerequisites:
11+
uses: pulumiverse/infra/.github/workflows/provider-prerequisites.yaml@main
12+
with:
13+
provider: heroku
14+
build:
15+
needs: prerequisites
16+
uses: pulumiverse/infra/.github/workflows/provider-build-sdk.yaml@main
17+
with:
18+
provider: heroku

.github/workflows/release.yml

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

.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: pulumi-resource-heroku
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/pulumiverse/pulumi-heroku/provider/pkg/version.Version={{.Tag }}
22+
main: ./cmd/pulumi-resource-heroku/
23+
changelog:
24+
skip: true
25+
release:
26+
disable: false
27+
prerelease: auto
28+
snapshot:
29+
name_template: "{{ .Tag }}-SNAPSHOT"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Heroku Resource Provider
22

3-
The Foo Resource Provider lets you manage [Heroku](http://heroku.com) resources.
3+
The Heroku Resource Provider lets you manage [Heroku](http://heroku.com) resources.
44

55
## Installing
66

docs/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Heroku
3+
meta_desc: Provides an overview of the Heroku Provider for Pulumi.
4+
layout: overview
5+
---
6+
7+
The Heroku provider for Pulumi can be used to provision any of the cloud resources available in Heroku.

docs/installation-configuration.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Heroku
3+
meta_desc: Information on how to install the Pulumi Heroku provider.
4+
layout: installation
5+
---
6+
7+
## Installation
8+
9+
The Pulumi Heroku provider is available as a package in all Pulumi languages:
10+
11+
* JavaScript/TypeScript: [`@pulumiverse/heroku`](https://www.npmjs.com/package/@pulumiverse/heroku)
12+
* Python: [`pulumiverse_heroku`](https://pypi.org/project/pulumiverse_heroku/)
13+
* Go: [`github.com/pulumiverse/pulumi-heroku/sdk/go/heroku`](https://github.com/pulumiverse/pulumi-heroku/sdk/go/heroku)
14+
* .NET: [`Pulumiverse.Heroku`](https://www.nuget.org/packages/Pulumiverse.Heroku)
15+
16+
### Provider Binary
17+
18+
The Heroku provider binary is a third party binary. It can be installed using the `pulumi plugin` command.
19+
20+
```bash
21+
pulumi plugin install resource heroku v0.1.0
22+
```
23+
24+
Replace the version string with your desired version.

go.work

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
go 1.18
2+
3+
use (
4+
./provider
5+
./sdk
6+
)

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0=

0 commit comments

Comments
 (0)