diff --git a/.github/actions/download-bin/action.yml b/.github/actions/download-bin/action.yml new file mode 100644 index 0000000..9c8a11d --- /dev/null +++ b/.github/actions/download-bin/action.yml @@ -0,0 +1,16 @@ +name: Download binary assets +description: Downloads the provider and tfgen binaries to `bin/`. + +runs: + using: "composite" + steps: + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v4 + with: + name: ns1-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + shell: bash + run: | + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin + find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; diff --git a/.github/actions/download-sdk/action.yml b/.github/actions/download-sdk/action.yml new file mode 100644 index 0000000..1fd5484 --- /dev/null +++ b/.github/actions/download-sdk/action.yml @@ -0,0 +1,19 @@ +name: Download SDK asset +description: Restores the SDK asset for a language. + +inputs: + language: + required: true + description: One of nodejs, python, dotnet, go, java + +runs: + using: "composite" + steps: + - name: Download ${{ inputs.language }} SDK + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + shell: bash + run: tar -zxf ${{ github.workspace }}/sdk/${{ inputs.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ inputs.language }} diff --git a/.github/actions/upload-bin/action.yml b/.github/actions/upload-bin/action.yml new file mode 100644 index 0000000..92316f0 --- /dev/null +++ b/.github/actions/upload-bin/action.yml @@ -0,0 +1,15 @@ +name: Upload bin assets +description: Uploads the provider and tfgen binaries to `bin/`. + +runs: + using: "composite" + steps: + - name: Tar provider binaries + shell: bash + run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-ns1 pulumi-tfgen-ns1 + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ns1-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 diff --git a/.github/actions/upload-sdk/action.yml b/.github/actions/upload-sdk/action.yml new file mode 100644 index 0000000..77d4849 --- /dev/null +++ b/.github/actions/upload-sdk/action.yml @@ -0,0 +1,20 @@ +name: Upload SDK asset +description: Upload the SDK for a specific language as an asset for the workflow. + +inputs: + language: + required: true + description: One of nodejs, python, dotnet, go, java + +runs: + using: "composite" + steps: + - name: Compress SDK folder + shell: bash + run: tar -zcf sdk/${{ inputs.language }}.tar.gz -C sdk/${{ inputs.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ inputs.language }}.tar.gz + retention-days: 30 diff --git a/.github/workflows/build_sdk.yml b/.github/workflows/build_sdk.yml index af910c8..4147f87 100644 --- a/.github/workflows/build_sdk.yml +++ b/.github/workflows/build_sdk.yml @@ -53,17 +53,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin - - name: Untar provider binaries - run: >- - tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace}}/bin - - find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - name: Install plugins run: make install_plugins - name: Update path @@ -79,11 +70,7 @@ jobs: sdk/go/**/pulumiUtilities.go sdk/nodejs/package.json sdk/python/pyproject.toml - - name: Compress SDK folder - run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - - name: Upload artifacts - uses: actions/upload-artifact@v4 + - name: Upload SDK + uses: ./.github/actions/upload-sdk with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz - retention-days: 30 + language: ${{ matrix.language }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f3249ed..5c9ffa3 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -130,15 +130,17 @@ jobs: - publish runs-on: ubuntu-latest steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumicli, pulumictl, go, node, dotnet, python, java - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.18 + uses: pulumi/pulumi-package-publisher@v0.0.19 with: sdk: all version: ${{ needs.prerequisites.outputs.version }} - dotnet-version: "6.0.x" - java-version: "11" - node-version: "20.x" - python-version: "3.11.8" tag_release_if_labeled_needs_release: name: Tag release if labeled as needs-release @@ -175,26 +177,13 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin - - name: Untar provider binaries - run: >- - tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace}}/bin - - find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: actions/download-artifact@v4 + uses: ./.github/actions/download-sdk with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + language: ${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index de9bc76..132cc70 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -92,15 +92,17 @@ jobs: - publish runs-on: ubuntu-latest steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumicli, pulumictl, go, node, dotnet, python, java - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.18 + uses: pulumi/pulumi-package-publisher@v0.0.19 with: sdk: all version: ${{ needs.prerequisites.outputs.version }} - dotnet-version: "6.0.x" - java-version: "11" - node-version: "20.x" - python-version: "3.11.8" publish_go_sdk: name: publish_go_sdk needs: @@ -150,26 +152,13 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin - - name: Untar provider binaries - run: >- - tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace}}/bin - - find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: actions/download-artifact@v4 + uses: ./.github/actions/download-sdk with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + language: ${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/.github/workflows/prerequisites.yml b/.github/workflows/prerequisites.yml index 00cd554..981f428 100644 --- a/.github/workflows/prerequisites.yml +++ b/.github/workflows/prerequisites.yml @@ -92,13 +92,5 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Tar provider binaries - run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace }}/bin/ pulumi-resource-ns1 - pulumi-tfgen-ns1 - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin/provider.tar.gz - retention-days: 30 + - name: Upload bin + uses: ./.github/actions/upload-bin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0742f5..fdde4c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -107,15 +107,17 @@ jobs: - publish runs-on: ubuntu-latest steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumicli, pulumictl, go, node, dotnet, python, java - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.18 + uses: pulumi/pulumi-package-publisher@v0.0.19 with: sdk: all version: ${{ needs.prerequisites.outputs.version }} - dotnet-version: "6.0.x" - java-version: "11" - node-version: "20.x" - python-version: "3.11.8" publish_go_sdk: name: publish_go_sdk needs: @@ -183,26 +185,13 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin - - name: Untar provider binaries - run: >- - tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace}}/bin - - find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: actions/download-artifact@v4 + uses: ./.github/actions/download-sdk with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + language: ${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index c216425..27d9b92 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -116,26 +116,13 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: ns1-provider.tar.gz - path: ${{ github.workspace }}/bin - - name: Untar provider binaries - run: >- - tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ - github.workspace}}/bin - - find ${{ github.workspace }} -name "pulumi-*-ns1" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: actions/download-artifact@v4 + uses: ./.github/actions/download-sdk with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + language: ${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps