Skip to content

Commit

Permalink
init pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
larrywax committed Aug 21, 2024
1 parent 4376226 commit 0b42de3
Show file tree
Hide file tree
Showing 35 changed files with 189 additions and 158 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/lint.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: lint

on:
workflow_call:
inputs: {}
pull_request:
branches:
- main
- v*
- feature*
paths-ignore:
- CHANGELOG.md

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install go
uses: actions/setup-go@v4
with:
# The versions of golangci-lint and setup-go here cross-depend and need to update together.
go-version: 1.21
# Either this action or golangci-lint needs to disable the cache
cache: false
- name: disarm go:embed directives to enable lint
continue-on-error: true # this fails if there are no go:embed directives
run: |
git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g'
- name: prepare upstream
continue-on-error: true
run: make upstream
- run: cd provider && go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.1
working-directory: provider
skip-pkg-cache: true
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
with:
enable-cache: true
- name: Build sdks
run: devbox run -- make build_sdks
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: release
on:
push:
tags:
- v*.*.*
env:
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET
# AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
PUBLISH_NPM: true
NPM_REGISTRY_URL: https://registry.npmjs.org
# IF YOU NEED TO PUBLISH A NUGET PACKAGE THEN ENSURE AN NUGET_PUBLISH_KEY
# SECRET IS SET AND PUBLISH_NUGET: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE
# NPM REGISTRY THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
# NUGET_PUBLISH_KEY: ${{ YOUR NUGET PUBLISH KEY HERE }}
# NUGET_FEED_URL: https://api.nuget.org/v3/index.json
# PUBLISH_NUGET: true
# IF YOU NEED TO PUBLISH A PYPI PACKAGE SET PUBLISH_PYPI: TRUE AND CHANGE PYPI_PASSWORD, PYPI_USERNAME TO YOUR CREDENTIALS.
# IF YOU WANT TO PUBLISH TO AN ALTERNATIVE PYPI REGISTRY THEN ENSURE THE PYPI_REPOSITORY_URL IS SET.
# PYPI_PASSWORD: ${{ YOUR PYPI PASSWORD HERE }}
# PYPI_USERNAME: "YOUR PYPI USERNAME HERE"
# PYPI_REPOSITORY_URL: ""
# PUBLISH_PYPI: true
jobs:
publish_binary:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.5.0
with:
repo: pulumi/pulumictl
- name: Set PreRelease Version
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
args: -p 3 release --rm-dist
version: latest
strategy:
fail-fast: true
matrix:
goversion:
- 1.21.x
publish_sdk:
name: Publish SDKs
runs-on: ubuntu-latest
needs: publish_binary
steps:
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.6
strategy:
fail-fast: true
matrix:
dotnetversion:
- 3.1.301
goversion:
- 1.21.x
language:
- nodejs
# - python
# - dotnet
- go
nodeversion:
- 20.x
pythonversion:
- "3.9"
File renamed without changes.
File renamed without changes.
79 changes: 0 additions & 79 deletions deployment-templates/release.yml

This file was deleted.

18 changes: 10 additions & 8 deletions provider/cmd/pulumi-resource-mysql/schema.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func Provider() tfbridge.ProviderInfo {
// PluginDownloadURL is an optional URL used to download the Provider
// for use in Pulumi programs
// e.g https://github.com/org/pulumi-provider-name/releases/
PluginDownloadURL: "",
PluginDownloadURL: "github://api.github.com/unobravo/pulumi-mysql",
Description: "A Pulumi package for creating and managing mysql cloud resources.",
// category/cloud tag helps with categorizing the package in the Pulumi Registry.
// For all available categories, see `Keywords` in
Expand All @@ -150,6 +150,7 @@ func Provider() tfbridge.ProviderInfo {
// },
},
JavaScript: &tfbridge.JavaScriptInfo{
PackageName: "@unobravo/pulumi-mysql",
// List any npm dependencies and their versions
Dependencies: map[string]string{
"@pulumi/pulumi": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DefaultRoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/GlobalVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Grant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/RdsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Sql.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/TiConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
AdditionalSecretOutputs =
{
"authStringHashed",
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/UserPassword.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/unobravo/pulumi-mysql",
AdditionalSecretOutputs =
{
"plaintextPassword",
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static class Utilities
{
var dst = src ?? new global::Pulumi.InvokeOptions{};
dst.Version = src?.Version ?? Version;
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "github://api.github.com/unobravo/pulumi-mysql";
return dst;
}

Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"resource": true,
"name": "mysql"
"name": "mysql",
"server": "github://api.github.com/unobravo/pulumi-mysql"
}
4 changes: 2 additions & 2 deletions sdk/go/mysql/internal/pulumiUtilities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0b42de3

Please sign in to comment.