diff --git a/README.md b/README.md index 8d01cb7..1624a9d 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,43 @@ # pulumi-package-publisher + A composite action for publishing Pulumi packages _This Action is currently in preview and meant for internal use. Any functionality can and likely will change._ ### Purpose + This Action automates setup and publication to the package registries of four Pulumi languages. ### Setup +Ensure the following tools are installed: + +- Pulumi CLI +- pulumictl +- Go +- Node.js +- Python +- Java (and Gradle) + +It's expected that the repository is checked out. + Set the following environment variables in your Workflow and your GitHub Action secrets: ```yaml env: - DOTNETVERSION: | - 6.0.x - 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOVERSION: 1.20.1 - JAVAVERSION: "11" - NODEVERSION: 16.x NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} ``` ### Use Add this action to your Workflow as a step to publish to all four supported registries: + - PyPI - Maven - npm diff --git a/action.yml b/action.yml index 9f20a43..53fe201 100644 --- a/action.yml +++ b/action.yml @@ -4,18 +4,6 @@ inputs: version: description: The version of the provider being published. required: true - dotnet-version: - description: The version of Dotnet being used in the provider - required: true - java-version: - description: The version of Java being used in the provider - required: true - node-version: - description: The version of Node being used in the provider - required: true - python-version: - description: The version of Python being used in the provider - required: true assertPrerelease: description: | Assert that `version` argument describes a pre-release. @@ -67,20 +55,6 @@ runs: exit 1; fi shell: bash - - name: Checkout Repo - uses: actions/checkout@v3 - with: - repository: ${{ github.repository }} - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVERSION }} - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v2 # `uses:` statements do not support expressions # (https://github.com/actions/runner/issues/895), so this is invalid: @@ -104,22 +78,18 @@ runs: if: (contains(inputs.sdk, 'nodejs') || (contains(inputs.sdk, 'all') && !contains(inputs.sdk, '!all'))) && !contains(inputs.sdk, '!nodejs') with: version: ${{ inputs.version }} - node-version: ${{ inputs.node-version }} - name: .NET - Publish to Nuget if: (contains(inputs.sdk, 'dotnet') || (contains(inputs.sdk, 'all') && !contains(inputs.sdk, '!all'))) && !contains(inputs.sdk, '!dotnet') uses: ./.pulumi-package-publish/lang/dotnet with: version: ${{ inputs.version }} - dotnet-version: ${{ inputs.dotnet-version }} - name: Python - Publish to PyPi if: (contains(inputs.sdk, 'python') || (contains(inputs.sdk, 'all') && !contains(inputs.sdk, '!all'))) && !contains(inputs.sdk, '!python') uses: ./.pulumi-package-publish/lang/python with: version: ${{ inputs.version }} - python-version: ${{ inputs.python-version }} - name: Java - Publish to Maven if: (contains(inputs.sdk, 'java') || (contains(inputs.sdk, 'all') && !contains(inputs.sdk, '!all'))) && !contains(inputs.sdk, '!java') uses: ./.pulumi-package-publish/lang/java with: version: ${{ inputs.version }} - java-version: ${{ inputs.java-version }} diff --git a/lang/dotnet/action.yml b/lang/dotnet/action.yml index 6a5dbb0..bc53b9b 100644 --- a/lang/dotnet/action.yml +++ b/lang/dotnet/action.yml @@ -9,17 +9,10 @@ inputs: TODO: Validate that the SDK we are publishing matches this input. required: true - dotnet-version: - description: The version of Dotnet being used in the provider - required: true runs: using: "composite" steps: - - name: Setup DotNet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ inputs.dotnet-version }} - name: Download dotnet SDK uses: actions/download-artifact@v4 with: diff --git a/lang/java/action.yml b/lang/java/action.yml index fc7d8de..ce4f251 100644 --- a/lang/java/action.yml +++ b/lang/java/action.yml @@ -6,23 +6,10 @@ inputs: version: description: The version of the provider being published. required: true - java-version: - description: The version of Java being used in the provider - required: true runs: using: "composite" steps: - - name: Setup Java - uses: actions/setup-java@v3 - with: - cache: gradle - distribution: temurin - java-version: ${{ inputs.java-version }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: "7.6" - name: Download java SDK uses: actions/download-artifact@v4 with: diff --git a/lang/nodejs/action.yml b/lang/nodejs/action.yml index deab278..393196b 100644 --- a/lang/nodejs/action.yml +++ b/lang/nodejs/action.yml @@ -6,18 +6,10 @@ inputs: version: description: The version of the provider being published. required: true - node-version: - description: The version of Node being used in the provider - required: true runs: using: "composite" steps: - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ inputs.node-version }} - registry-url: https://registry.npmjs.org - name: Download nodejs SDK uses: actions/download-artifact@v4 with: diff --git a/lang/python/action.yml b/lang/python/action.yml index df9a71d..859bfd4 100644 --- a/lang/python/action.yml +++ b/lang/python/action.yml @@ -9,17 +9,10 @@ inputs: TODO: Validate that the SDK we are publishing matches this input. required: true - python-version: - description: The version of Python being used in the provider - required: true runs: using: "composite" steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - name: Download python SDK uses: actions/download-artifact@v4 with: