Skip to content

Commit

Permalink
Added npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
scav committed Jul 5, 2022
1 parent 81ab70b commit 80f78a3
Show file tree
Hide file tree
Showing 25 changed files with 78 additions and 390 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_NPM: false
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
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Check worktree clean
run: |
git update-index -q --refresh
if ! git diff-files --quiet; then
if ! git diff-files; then
>&2 echo "error: working tree is not clean, aborting!"
git status
git diff
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SHELL := /bin/bash
PACK := flux
ORG := scav
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @pulumi/${PACK}
NODE_MODULE_NAME := @scav/${PACK}
TF_NAME := ${PACK}
PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
Expand Down
16 changes: 9 additions & 7 deletions provider/cmd/pulumi-resource-flux/schema.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "flux",
"description": "A Pulumi package for creating and managing flux cloud resources.",
"displayName": "Flux",
"description": "A Pulumi package for bootstrapping Flux in Kubernetes.",
"keywords": [
"pulumi",
"flux",
"category/cloud"
"kubernetes"
],
"homepage": "https://github.com/scav/pulumi-flux",
"homepage": "http://fluxcd.io/",
"license": "Apache-2.0",
"attribution": "This Pulumi package is based on the [`flux` Terraform Provider](https://github.com/fluxcd/terraform-provider-flux).",
"repository": "https://github.com/scav/pulumi-flux",
"publisher": "Pulumi",
"pluginDownloadURL": "https://github.com/scav/pulumi-flux/releases/",
"publisher": "scav",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
Expand Down Expand Up @@ -288,7 +290,7 @@
"go": {
"generateExtraInputTypes": true,
"generateResourceContainerTypes": true,
"importBasePath": "github.com/pulumi/pulumi-flux/sdk/go/flux"
"importBasePath": "github.com/scav/pulumi-flux/sdk/go/flux"
},
"nodejs": {
"compatibility": "tfbridge20",
Expand All @@ -300,8 +302,8 @@
"@types/node": "^10.0.0"
},
"disableUnionOutputTypes": true,
"packageDescription": "A Pulumi package for creating and managing flux cloud resources.",
"packageName": "",
"packageDescription": "A Pulumi package for bootstrapping Flux in Kubernetes.",
"packageName": "@scav/pulumi-flux",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/fluxcd/terraform-provider-flux)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi/pulumi-flux` repo](https://github.com/pulumi/pulumi-flux/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`fluxcd/terraform-provider-flux` repo](https://github.com/fluxcd/terraform-provider-flux/issues).",
"typescriptVersion": ""
},
Expand Down
37 changes: 6 additions & 31 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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: "https://github.com/scav/pulumi-flux/releases/download/v0.0.1/",
PluginDownloadURL: "https://github.com/scav/pulumi-flux/releases/",
Description: "A Pulumi package for bootstrapping Flux in Kubernetes.",
// category/cloud tag helps with categorizing the package in the Pulumi Registry.
// For all available categories, see `Keywords` in
Expand All @@ -79,37 +79,16 @@ func Provider() tfbridge.ProviderInfo {
Homepage: "http://fluxcd.io/",
Repository: "https://github.com/scav/pulumi-flux",
// The GitHub Org for the provider - defaults to `terraform-providers`
GitHubOrg: "fluxcd",
Config: map[string]*tfbridge.SchemaInfo{
// Add any required configuration here, or remove the example below if
// no additional points are required.
// "region": {
// Type: tfbridge.MakeType("region", "Region"),
// Default: &tfbridge.DefaultInfo{
// EnvVars: []string{"AWS_REGION", "AWS_DEFAULT_REGION"},
// },
// },
},
GitHubOrg: "fluxcd",
Config: map[string]*tfbridge.SchemaInfo{},
PreConfigureCallback: preConfigureCallback,
Resources: map[string]*tfbridge.ResourceInfo{
// Map each resource in the Terraform provider to a Pulumi type. Two examples
// are below - the single line form is the common case. The multi-line form is
// needed only if you wish to override types or other default options.
//
// "aws_iam_role": {Tok: tfbridge.MakeResource(mainPkg, mainMod, "IamRole")}
//
// "aws_acm_certificate": {
// Tok: tfbridge.MakeResource(mainPkg, mainMod, "Certificate"),
// Fields: map[string]*tfbridge.SchemaInfo{
// "tags": {Type: tfbridge.MakeType(mainPkg, "Tags")},
// },
// },
},
Resources: map[string]*tfbridge.ResourceInfo{},
DataSources: map[string]*tfbridge.DataSourceInfo{
"flux_install": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "DataInstall")},
"flux_sync": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "DataSync")},
},
JavaScript: &tfbridge.JavaScriptInfo{
PackageName: "@scav/pulumi-flux",
// List any npm dependencies and their versions
Dependencies: map[string]string{
"@pulumi/pulumi": "^3.0.0",
Expand All @@ -118,10 +97,6 @@ func Provider() tfbridge.ProviderInfo {
"@types/node": "^10.0.0", // so we can access strongly typed node definitions.
"@types/mime": "^2.0.0",
},
// See the documentation for tfbridge.OverlayInfo for how to lay out this
// section, or refer to the AWS provider. Delete this section if there are
// no overlay files.
//Overlay: &tfbridge.OverlayInfo{},
},
Python: &tfbridge.PythonInfo{
// List any Python dependencies and their version ranges
Expand All @@ -131,7 +106,7 @@ func Provider() tfbridge.ProviderInfo {
},
Golang: &tfbridge.GolangInfo{
ImportBasePath: filepath.Join(
fmt.Sprintf("github.com/pulumi/pulumi-%[1]s/sdk/", mainPkg),
fmt.Sprintf("github.com/scav/pulumi-%[1]s/sdk/", mainPkg),
tfbridge.GetModuleMajorVersion(version.Version),
"go",
mainPkg,
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/scav/pulumi-flux/releases/",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
8 changes: 4 additions & 4 deletions sdk/dotnet/Pulumi.Flux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Pulumi</Authors>
<Company>Pulumi</Company>
<Description>A Pulumi package for creating and managing flux cloud resources.</Description>
<Authors>scav</Authors>
<Company>scav</Company>
<Description>A Pulumi package for bootstrapping Flux in Kubernetes.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/scav/pulumi-flux</PackageProjectUrl>
<PackageProjectUrl>http://fluxcd.io/</PackageProjectUrl>
<RepositoryUrl>https://github.com/scav/pulumi-flux</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon>

Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A Pulumi package for creating and managing flux cloud resources.
A Pulumi package for bootstrapping Flux in Kubernetes.
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 ?? "https://github.com/scav/pulumi-flux/releases/";
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": "flux"
"name": "flux",
"server": "https://github.com/scav/pulumi-flux/releases/"
}
1 change: 1 addition & 0 deletions sdk/go/flux/dataInstall.go

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

1 change: 1 addition & 0 deletions sdk/go/flux/dataSync.go

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

2 changes: 1 addition & 1 deletion sdk/go/flux/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// A Pulumi package for creating and managing flux cloud resources.
// A Pulumi package for bootstrapping Flux in Kubernetes.
//
package flux
1 change: 1 addition & 0 deletions sdk/go/flux/provider.go

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

3 changes: 2 additions & 1 deletion sdk/go/flux/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"resource": true,
"name": "flux"
"name": "flux",
"server": "https://github.com/scav/pulumi-flux/releases/"
}
14 changes: 14 additions & 0 deletions sdk/go/flux/pulumiUtilities.go

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

9 changes: 5 additions & 4 deletions sdk/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@pulumi/flux",
"version": "${VERSION}",
"description": "A Pulumi package for creating and managing flux cloud resources.",
"description": "A Pulumi package for bootstrapping Flux in Kubernetes.",
"keywords": [
"pulumi",
"flux",
"category/cloud"
"kubernetes"
],
"homepage": "https://github.com/scav/pulumi-flux",
"homepage": "http://fluxcd.io/",
"repository": "https://github.com/scav/pulumi-flux",
"license": "Apache-2.0",
"scripts": {
Expand All @@ -23,6 +23,7 @@
"typescript": "^4.3.5"
},
"pulumi": {
"resource": true
"resource": true,
"pluginDownloadURL": "https://github.com/scav/pulumi-flux/releases/"
}
}
2 changes: 1 addition & 1 deletion sdk/nodejs/scripts/install-pulumi-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (args.indexOf("${VERSION}") !== -1) {
process.exit(0);
}

var res = childProcess.spawnSync("pulumi", ["plugin", "install"].concat(args), {
var res = childProcess.spawnSync("pulumi", ["plugin", "install", "--server", "https://github.com/scav/pulumi-flux/releases/"].concat(args), {
stdio: ["ignore", "inherit", "inherit"]
});

Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ export function getVersion(): string {

/** @internal */
export function resourceOptsDefaults(): any {
return { version: getVersion() };
return { version: getVersion(), pluginDownloadURL: "https://github.com/scav/pulumi-flux/releases/" };
}
Loading

0 comments on commit 80f78a3

Please sign in to comment.