Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to full use of tools/resourcedocsgen #4663

Merged
merged 11 commits into from
Jun 5, 2024
13 changes: 5 additions & 8 deletions .github/workflows/generate-package-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,25 @@ jobs:
- name: Sleep to prevent hitting secondary rate limits
if: steps.skip-run.outputs.skip != 1
run: sleep 1
- name: Install Registrygen CLI
if: steps.skip-run.outputs.skip != 1
uses: jaxxstorm/[email protected]
with:
repo: pulumi/registrygen
- name: Check for a new version
if: steps.skip-run.outputs.skip != 1
id: version
run: |
echo 'PROVIDER_VERSION<<EOF' >> $GITHUB_ENV
registrygen pkgversion --repoSlug ${{ matrix.repoSlug }} \
cd tools/resourcedocsgen && \
go run github.com/pulumi/registry/tools/resourcedocsgen pkgversion --repoSlug ${{ matrix.repoSlug }} \
>> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# This will only be populated if the registry version does not match the latest provider version.
- name: Display new version
if: env.PROVIDER_VERSION
run: echo ${{ env.PROVIDER_VERSION}}
# We only need to run the following steps if registrygen found a newer version of the community provider.
# We only need to run the following steps if resourcedocsgen found a newer version of the community provider.
- name: Generate Package Metadata
if: env.PROVIDER_VERSION
run: |
registrygen metadata --repoSlug ${{ matrix.repoSlug }} --schemaFile ${{ matrix.schemaFile }} \
cd tools/resourcedocsgen && go run github.com/pulumi/registry/tools/resourcedocsgen \
metadata --repoSlug ${{ matrix.repoSlug }} --schemaFile ${{ matrix.schemaFile }} \
--version ${{ env.PROVIDER_VERSION }}
- name: Create registry PR
if: env.PROVIDER_VERSION
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/publish-provider-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ jobs:
- run: echo "Building ${{ env.PROVIDER_NAME }} docs @ ${{ env.PROVIDER_VERSION }}"
- name: checkout registry repo
uses: actions/checkout@v2
- name: Install Registrygen CLI
uses: jaxxstorm/[email protected]
with:
repo: pulumi/registrygen
- name: Generate Package Metadata
run: |
registrygen metadata --providerName=${{ env.PROVIDER_SHORT_NAME }} --repoSlug pulumi/pulumi-${{ env.PROVIDER_SHORT_NAME }} --schemaFile="${{ env.PROVIDER_SCHEMA_PATH }}" --version="${{ env.PROVIDER_VERSION }}" --publisher Pulumi
cd tools/resourcedocsgen && go run github.com/pulumi/registry/tools/resourcedocsgen \
metadata --providerName=${{ env.PROVIDER_SHORT_NAME }} --repoSlug pulumi/pulumi-${{ env.PROVIDER_SHORT_NAME }} --schemaFile="${{ env.PROVIDER_SCHEMA_PATH }}" --version="${{ env.PROVIDER_VERSION }}" --publisher Pulumi
- name: git status
run: git status && git diff
- name: Create registry PR
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ public
.vscode
cypress/videos
cypress/screenshots
tools/resourcedocsgen/resourcedocsgen
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ cp ../docs/content/registry/packages/aws/how-to-guides ./themes/default/content/

#### Generating API docs for packages

The API docs for packages can be generated on-demand using the [`registrygen` tool](https://github.com/pulumi/registrygen).
The API docs for packages can be generated on-demand using the [`resourcedocsgen` tool](tools/resourcedocsgen/README.md).

```
go install github.com/pulumi/registrygen@master
cd tools/resourcedocsgen
go build -o "${GOPATH}/bin/resourcedocsgen" .
```

Run `registrygen --help` for help regarding its use or [see the `registrygen` README](https://github.com/pulumi/registrygen#readme).
Run `resourcedocsgen --help` for help regarding its use or [see the `resourcedocsgen` README](tools/resourcedocsgen/README.md).

## Submitting, merging and releasing

Expand Down
2 changes: 1 addition & 1 deletion tools/resourcedocsgen/cmd/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/golang/glog"
"github.com/hashicorp/hcl/v2"
"github.com/pkg/errors"
"github.com/pulumi/docs/tools/resourcedocsgen/pkg"
"github.com/pulumi/registry/tools/resourcedocsgen/pkg"
"github.com/spf13/cobra"

docsgen "github.com/pulumi/pulumi/pkg/v3/codegen/docs"
Expand Down
2 changes: 1 addition & 1 deletion tools/resourcedocsgen/cmd/docs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"github.com/pkg/errors"

"github.com/pulumi/docs/tools/resourcedocsgen/pkg"
pschema "github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
"github.com/pulumi/registry/tools/resourcedocsgen/pkg"
)

func getRepoSlug(repoURL string) (string, error) {
Expand Down
Loading
Loading