diff --git a/.github/actions/download-bin/action.yml b/.github/actions/download-bin/action.yml new file mode 100644 index 000000000..fb543031e --- /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: datadog-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-*-datadog" -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 000000000..1fd54841b --- /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 000000000..04d386c0e --- /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-datadog pulumi-tfgen-datadog + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: datadog-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 000000000..77d484942 --- /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 6e46f31f3..ce6278f8a 100644 --- a/.github/workflows/build_sdk.yml +++ b/.github/workflows/build_sdk.yml @@ -54,17 +54,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: datadog-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-*-datadog" -print -exec chmod +x {} \; + - name: Download bin + uses: ./.github/actions/download-bin - name: Install plugins run: make install_plugins - name: Update path @@ -80,11 +71,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 f4c98d7f1..b091f37cc 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -127,15 +127,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 @@ -172,26 +174,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: datadog-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-*-datadog" -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 c673026f8..06fb59d97 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -89,15 +89,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: @@ -147,26 +149,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: datadog-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-*-datadog" -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 956171725..8d4e959d6 100644 --- a/.github/workflows/prerequisites.yml +++ b/.github/workflows/prerequisites.yml @@ -93,13 +93,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-datadog - pulumi-tfgen-datadog - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: datadog-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 1d691b537..d1ea9e3d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,15 +104,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: @@ -180,26 +182,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: datadog-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-*-datadog" -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 7ef045169..42968302e 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -110,26 +110,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: datadog-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-*-datadog" -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