Skip to content

Commit

Permalink
Instantiate pulumi-tf-provider-boilerplate for rockset-provider (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddn0 committed Dec 9, 2023
1 parent f42a59a commit 7063c6d
Show file tree
Hide file tree
Showing 229 changed files with 54,962 additions and 635 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Simplified form of https://github.com/pulumi/pulumi-package-publisher/main/action.yml
name: release
on:
push:
tags:
- v*.*.*
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache-dependency-path: '**/go.sum'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- run: make build_python
- run: make build_go
- uses: actions/upload-artifact@v3
with:
name: python-sdk.tar.gz
path: ${{ github.workspace }}/sdk/python
- uses: actions/upload-artifact@v3
with:
name: go-sdk.tar.gz
path: ${{ github.workspace }}/sdk/go

publish-go:
needs: build
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache-dependency-path: '**/go.sum'
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
version: latest

publish-python:
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/pulumi_rockset
permissions:
# Required for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: python-sdk.tar.gz
path: ${{ github.workspace }}/sdk/python
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ github.workspace }}/sdk/python/bin/dist
69 changes: 69 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: test
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache-dependency-path: '**/go.sum'
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- run: make tfgen
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
working-directory: provider

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache-dependency-path: '**/go.sum'
- uses: actions/setup-node@v3
with:
node-version: "20"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "8"
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- run: make provider
- name: Check for uncommitted generated files
run: |
make build_sdks
if [[ $(git status --porcelain | wc -l) != "0" ]]; then
git status
echo "did you run make build_sdks?"
exit 1
fi
- run: make test
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ on:
- opened
schedule:
- cron: '0 5 * * *'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
upgrade_provider:
upgrade-provider:
name: upgrade-provider
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@main
- uses: pulumi/pulumi-upgrade-provider-action@main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ provider/**/schema-embed.json
**/version.txt
**/nuget
**/dist

.ignore
6 changes: 3 additions & 3 deletions deployment-templates/.goreleaser.yml → .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-rockset
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/your-org-name/pulumi-xyz/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/ddn0/pulumi-rockset/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-rockset/
changelog:
skip: true
release:
Expand Down
10 changes: 0 additions & 10 deletions CHANGELOG.md

This file was deleted.

12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PROJECT_NAME := xyz Package
PROJECT_NAME := rockset Package

SHELL := /bin/bash
PACK := xyz
ORG := pulumi
PACK := rockset
ORG := ddn0
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @pulumi/${PACK}
TF_NAME := ${PACK}
Expand All @@ -29,13 +29,13 @@ prepare::
mv "provider/cmd/pulumi-resource-x${EMPTY_TO_AVOID_SED}yz" provider/cmd/pulumi-resource-${NAME}

if [[ "${OS}" != "Darwin" ]]; then \
sed -i 's,github.com/pulumi/pulumi-xyz,${REPOSITORY},g' provider/go.mod; \
sed -i 's,github.com/pulumi/pulumi-rockset,${REPOSITORY},g' provider/go.mod; \
find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \
fi

# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "${OS}" == "Darwin" ]]; then \
sed -i '' 's,github.com/pulumi/pulumi-xyz,${REPOSITORY},g' provider/go.mod; \
sed -i '' 's,github.com/pulumi/pulumi-rockset,${REPOSITORY},g' provider/go.mod; \
find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \
fi

Expand Down Expand Up @@ -63,7 +63,7 @@ build_nodejs:: install_plugins tfgen # build the node sdk
cd sdk/nodejs/ && \
yarn install && \
yarn run tsc && \
cp -R scripts/ bin && \
(cp -R scripts/ bin || true) && \
cp ../../README.md ../../LICENSE package.json yarn.lock ./bin/ && \
sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json

Expand Down
56 changes: 0 additions & 56 deletions README-PROVIDER.md

This file was deleted.

Loading

0 comments on commit 7063c6d

Please sign in to comment.