Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Apr 30, 2024
1 parent 324cadd commit 649a266
Show file tree
Hide file tree
Showing 82 changed files with 24,476 additions and 1,053 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: release

on:
push:
workflow_dispatch:
tags:
- "*"

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
packages: write

jobs:
releaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: git fetch --force --tags

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ">=1.21.0"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: "https://registry.npmjs.org"
scope: "@sst-provider"

- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl

- name: Go Mod
working-directory: ./provider
run: go mod download

- run: make build_nodejs

- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}

- name: Publish
uses: JS-DevTools/npm-publish@v3
with:
access: "public"
token: ${{ secrets.NPM_TOKEN_SST_PROVIDER }}
package: ${{ github.workspace }}/sdk/nodejs/bin/package.json
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
archives:
- id: archive
name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
builds:
- binary: pulumi-resource-planetscale
dir: provider
goarch:
- amd64
- arm64
goos:
- darwin
- windows
- linux
ignore: []
ldflags:
- -X github.com/sst/pulumi-planetscale/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-planetscale/
#sort: asc
#use: git
release:
disable: false
snapshot:
name_template: "{{ .Tag }}-SNAPSHOT"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PROJECT_NAME := xyz Package
PROJECT_NAME := planetscale Package

SHELL := /bin/bash
PACK := xyz
PROJECT := github.com/pulumi/pulumi-xyz
NODE_MODULE_NAME := @abc/${PACK}
PACK := planetscale
PROJECT := github.com/sst/pulumi-planetscale
NODE_MODULE_NAME := @sst-provider/${PACK}
TF_NAME := ${PACK}
PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
Expand Down
26 changes: 5 additions & 21 deletions README-PROVIDER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Foo Resource Provider
# Planetscale Resource Provider

The Foo Resource Provider lets you manage [Foo](http://example.com) resources.
The Planetscale Resource Provider lets you manage [Planetscale](http://example.com) resources.

## Installing

Expand All @@ -11,37 +11,21 @@ This package is available for several languages/platforms:
To use from JavaScript or TypeScript in Node.js, install using either `npm`:

```bash
npm install @pulumi/foo
npm install @sst-provider/planetscale
```

or `yarn`:

```bash
yarn add @pulumi/foo
```

### Python

To use from Python, install using `pip`:

```bash
pip install pulumi_foo
yarn add @sst-provider/planetscale
```

### Go

To use from Go, use `go get` to grab the latest version of the library:

```bash
go get github.com/pulumi/pulumi-foo/sdk/go/...
```

### .NET

To use from .NET, install using `dotnet add package`:

```bash
dotnet add package Pulumi.Foo
go get github.com/sst/pulumi-planetscale/sdk/go/...
```

## Configuration
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ From the templated repository:
This will do the following:
- rename folders in `provider/cmd` to `pulumi-resource-foo` and `pulumi-tfgen-foo`
- replace dependencies in `provider/go.mod` to reflect your repository name
- find and replace all instances of the boilerplate `xyz` with the `NAME` of your provider.
- find and replace all instances of the boilerplate `abc` with the `ORG` of your provider.
- replace all instances of the `github.com/pulumi/pulumi-xyz` repository with the `REPOSITORY` location
- find and replace all instances of the boilerplate `planetscale` with the `NAME` of your provider.
- find and replace all instances of the boilerplate `sst-provider` with the `ORG` of your provider.
- replace all instances of the `github.com/sst/pulumi-planetscale` repository with the `REPOSITORY` location

Note for third-party providers:
- If you intend to publish on the Pulumi registry you will want to update the `DisplayName`, `Publisher`, and `Homepage` values in `provider/resources.go` to use your desired casing.
Expand Down Expand Up @@ -357,7 +357,7 @@ before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-xyz
- binary: pulumi-resource-planetscale
dir: provider
goarch:
- amd64
Expand All @@ -368,8 +368,8 @@ builds:
- linux
ignore: []
ldflags:
- -X github.com/pulumi/pulumi-xyz/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/sst/pulumi-planetscale/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-planetscale/
sort: asc
use: git
release:
Expand All @@ -394,18 +394,18 @@ dist
├── artifacts.json
├── config.yaml
├── metadata.json
├── pulumi-xyz_darwin_amd64_v1
│ └── pulumi-resource-xyz
├── pulumi-xyz_darwin_arm64
│ └── pulumi-resource-xyz
├── pulumi-xyz_linux_amd64_v1
│ └── pulumi-resource-xyz
├── pulumi-xyz_linux_arm64
│ └── pulumi-resource-xyz
├── pulumi-xyz_windows_amd64_v1
│ └── pulumi-resource-xyz.exe
└── pulumi-xyz_windows_arm64
└── pulumi-resource-xyz.exe
├── pulumi-planetscale_darwin_amd64_v1
│ └── pulumi-resource-planetscale
├── pulumi-planetscale_darwin_arm64
│ └── pulumi-resource-planetscale
├── pulumi-planetscale_linux_amd64_v1
│ └── pulumi-resource-planetscale
├── pulumi-planetscale_linux_arm64
│ └── pulumi-resource-planetscale
├── pulumi-planetscale_windows_amd64_v1
│ └── pulumi-resource-planetscale.exe
└── pulumi-planetscale_windows_arm64
└── pulumi-resource-planetscale.exe
```
Any of the provider binaries can be used to target the correct machine architecture
Expand Down
6 changes: 3 additions & 3 deletions deployment-templates/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-xyz
- binary: pulumi-resource-planetscale
dir: provider
env:
- CGO_ENABLED=0
Expand All @@ -18,8 +18,8 @@ builds:
- linux
ldflags:
# The line below MUST align with the module in current provider/go.mod
- -X github.com/pulumi/pulumi-xyz/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/sst/pulumi-planetscale/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-planetscale/
changelog:
skip: true
release:
Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/pulumi/pulumi-xyz/examples
module github.com/sst/pulumi-planetscale/examples

go 1.21
File renamed without changes.
Loading

0 comments on commit 649a266

Please sign in to comment.