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

Update GitHub Actions workflows. #403

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/download-bin/action.yml
Original file line number Diff line number Diff line change
@@ -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: splunk-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-*-splunk" -print -exec chmod +x {} \;
19 changes: 19 additions & 0 deletions .github/actions/download-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 15 additions & 0 deletions .github/actions/upload-bin/action.yml
Original file line number Diff line number Diff line change
@@ -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-splunk pulumi-tfgen-splunk
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: splunk-provider.tar.gz
path: ${{ github.workspace }}/bin/provider.tar.gz
retention-days: 30
20 changes: 20 additions & 0 deletions .github/actions/upload-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 5 additions & 18 deletions .github/workflows/build_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,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: splunk-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-*-splunk" -print -exec chmod +x {} \;
- name: Download bin
uses: ./.github/actions/download-bin
- name: Install plugins
run: make install_plugins
- name: Update path
Expand All @@ -81,11 +72,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 }}
33 changes: 11 additions & 22 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,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/[email protected].18
uses: pulumi/[email protected].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
Expand Down Expand Up @@ -177,26 +179,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: splunk-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-*-splunk" -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
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,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/[email protected].18
uses: pulumi/[email protected].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:
Expand Down Expand Up @@ -152,26 +154,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: splunk-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-*-splunk" -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
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,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-splunk
pulumi-tfgen-splunk
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: splunk-provider.tar.gz
path: ${{ github.workspace }}/bin/provider.tar.gz
retention-days: 30
- name: Upload bin
uses: ./.github/actions/upload-bin
33 changes: 11 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,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/[email protected].18
uses: pulumi/[email protected].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:
Expand Down Expand Up @@ -185,26 +187,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: splunk-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-*-splunk" -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
Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,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: splunk-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-*-splunk" -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
Expand Down
Loading