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. #452

Merged
merged 1 commit into from
Jun 21, 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
10 changes: 6 additions & 4 deletions .github/workflows/build_sdk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: "Build SDK"

on:
workflow_call: {}
workflow_call:
inputs:
version:
required: true
type: string

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -21,6 +25,7 @@ env:
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TF_APPEND_USER_AGENT: pulumi
PROVIDER_VERSION: ${{ inputs.version }}

jobs:
build_sdk:
Expand All @@ -38,9 +43,6 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Cache examples generation
uses: actions/cache@v4
with:
Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TF_APPEND_USER_AGENT: pulumi
jobs:
prerequisites:
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
default_branch: ${{ github.event.repository.default_branch }}
is_pr: ${{ github.event_name == 'pull_request' }}
is_automated: ${{ github.actor == 'dependabot[bot]' }}

build_sdk:
name: build_sdk
needs: prerequisites
uses: ./.github/workflows/build_sdk.yml
secrets: inherit
with:
version: ${{ needs.prerequisites.outputs.version }}

generate_coverage_data:
continue-on-error: true
Expand Down Expand Up @@ -87,17 +97,11 @@ jobs:
name: License Check
uses: ./.github/workflows/license.yml
secrets: inherit
prerequisites:
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
default_branch: ${{ github.event.repository.default_branch }}
is_pr: ${{ github.event_name == 'pull_request' }}
is_automated: ${{ github.actor == 'dependabot[bot]' }}

publish:
name: publish
needs:
- prerequisites
- test
- license_check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -136,13 +140,11 @@ jobs:
role-external-id: upload-pulumi-release
role-session-name: kafka@githubActions
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
- id: version
uses: pulumi/provider-version-action@v1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }}
PROVIDER_VERSION: ${{ steps.version.outputs.version }}
GORELEASER_CURRENT_TAG: v${{ needs.prerequisites.outputs.version }}
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
with:
args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout
60m0s
Expand All @@ -156,16 +158,16 @@ jobs:
status: ${{ job.status }}
publish_sdk:
name: publish_sdk
needs: publish
needs:
- prerequisites
- publish
runs-on: ubuntu-latest
steps:
- id: version
uses: pulumi/provider-version-action@v1
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.18
with:
sdk: all
version: ${{ steps.version.outputs.version }}
version: ${{ needs.prerequisites.outputs.version }}
dotnet-version: "6.0.x"
java-version: "11"
node-version: "20.x"
Expand Down Expand Up @@ -201,17 +203,18 @@ jobs:

test:
name: test
needs: build_sdk
needs:
- prerequisites
- build_sdk
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
env:
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Install Go
uses: actions/setup-go@v5
with:
Expand Down
49 changes: 26 additions & 23 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@ env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TF_APPEND_USER_AGENT: pulumi
jobs:
prerequisites:
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
default_branch: ${{ github.event.repository.default_branch }}
is_pr: ${{ github.event_name == 'pull_request' }}
is_automated: ${{ github.actor == 'dependabot[bot]' }}

build_sdk:
name: build_sdk
needs: prerequisites
uses: ./.github/workflows/build_sdk.yml
secrets: inherit
with:
version: ${{ needs.prerequisites.outputs.version }}

lint:
name: lint
Expand All @@ -34,17 +44,11 @@ jobs:
name: License Check
uses: ./.github/workflows/license.yml
secrets: inherit
prerequisites:
uses: ./.github/workflows/prerequisites.yml
secrets: inherit
with:
default_branch: ${{ github.event.repository.default_branch }}
is_pr: ${{ github.event_name == 'pull_request' }}
is_automated: ${{ github.actor == 'dependabot[bot]' }}

publish:
name: publish
needs:
- prerequisites
- test
- license_check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,13 +87,11 @@ jobs:
role-external-id: upload-pulumi-release
role-session-name: kafka@githubActions
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
- id: version
uses: pulumi/provider-version-action@v1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }}
PROVIDER_VERSION: ${{ steps.version.outputs.version }}
GORELEASER_CURRENT_TAG: v${{ needs.prerequisites.outputs.version }}
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
with:
args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout
60m0s
Expand All @@ -103,16 +105,16 @@ jobs:
status: ${{ job.status }}
publish_sdk:
name: publish_sdk
needs: publish
needs:
- prerequisites
- publish
runs-on: ubuntu-latest
steps:
- id: version
uses: pulumi/provider-version-action@v1
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.18
with:
sdk: all
version: ${{ steps.version.outputs.version }}
version: ${{ needs.prerequisites.outputs.version }}
dotnet-version: "6.0.x"
java-version: "11"
node-version: "20.x"
Expand All @@ -130,7 +132,9 @@ jobs:
uses: rtCamp/action-slack-notify@v2
publish_go_sdk:
name: publish_go_sdk
needs: publish_sdk
needs:
- prerequisites
- publish_sdk
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -140,8 +144,6 @@ jobs:
with:
tag: v0.0.46
repo: pulumi/pulumictl
- id: version
uses: pulumi/provider-version-action@v1
- name: Download Go SDK
uses: actions/download-artifact@v4
with:
Expand All @@ -157,7 +159,7 @@ jobs:
base-ref: ${{ github.sha }}
source: sdk
path: sdk
version: ${{ steps.version.outputs.version }}
version: ${{ needs.prerequisites.outputs.version }}
additive: false
# Avoid including other language SDKs & artifacts in the commit
files: |
Expand All @@ -166,17 +168,18 @@ jobs:
!*.tar.gz
test:
name: test
needs: build_sdk
needs:
- prerequisites
- build_sdk
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
env:
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Install Go
uses: actions/setup-go@v5
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
default_branch:
type: string
required: true
outputs:
version:
description: "Provider version being built"
value: ${{ jobs.prerequisites.outputs.version }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -36,10 +40,13 @@ jobs:
prerequisites:
name: prerequisites
runs-on: ubuntu-latest
outputs:
version: ${{ steps.provider-version.outputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pulumi/provider-version-action@v1
id: provider-version
with:
set-env: 'PROVIDER_VERSION'
- name: Cache examples generation
Expand Down
Loading
Loading