Skip to content

Commit 791a83e

Browse files
authored
Sketch an experimental job to update Java everywhere (#1612)
This job is intended to help with #1611 rollout. It is currently experimental and a few follow-up PRs may be coming. With GHA it is difficult to test things out before they are on main.
1 parent 3b3fe67 commit 791a83e

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/update-java.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Update pulumi/pulumi-java used in all providers to a target version.
2+
name: update-java
3+
4+
permissions: write-all # Equivalent to default permissions plus id-token: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
pulumi-java-version:
10+
description: Desired version of pulumi/pulumi-java to ugprade to.
11+
required: true
12+
type: string
13+
14+
env:
15+
ESC_ACTION_OIDC_AUTH: true
16+
ESC_ACTION_OIDC_ORGANIZATION: pulumi
17+
ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization
18+
ESC_ACTION_ENVIRONMENT: github-secrets/pulumi-ci-mgmt
19+
ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: GITHUB_TOKEN=PULUMI_BOT_TOKEN
20+
21+
jobs:
22+
23+
generate-providers-list:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Fetch secrets from ESC
27+
id: esc-secrets
28+
uses: pulumi/esc-action@cf5b30703ffd5ad60cc3a880c09b3a9592b9372d # v1
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30+
- id: get-providers
31+
run: echo "providers=$(jq . providers.json --compact-output)" >> "$GITHUB_OUTPUT"
32+
working-directory: provider-ci
33+
outputs:
34+
providers: ${{ steps.get-providers.outputs.providers }}
35+
36+
update-java:
37+
needs: generate-providers-list
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
# GitHub recommends only issuing 1 API request per second, and never
42+
# concurrently. For more information, see:
43+
# https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits
44+
max-parallel: 1
45+
matrix:
46+
provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }}
47+
48+
steps:
49+
- name: Fetch secrets from ESC
50+
id: esc-secrets
51+
uses: pulumi/esc-action@cf5b30703ffd5ad60cc3a880c09b3a9592b9372d # v1
52+
53+
- name: Checkout provider sources
54+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
55+
with:
56+
repository: pulumi/pulumi-${matrix.provider}
57+
path: provider
58+
59+
- name: Install upgrade-provider
60+
run: go install github.com/pulumi/upgrade-provider@main
61+
shell: bash
62+
63+
- name: Install pulumictl
64+
uses: jaxxstorm/[email protected]
65+
with:
66+
repo: pulumi/pulumictl
67+
68+
- name: Install Pulumi CLI
69+
uses: pulumi/actions@v6
70+
71+
- name: "Set up git identity: name"
72+
run: git config --global user.name '${{ github.actor }}'
73+
shell: bash
74+
75+
- name: Upgrade Java
76+
shell: bash
77+
env:
78+
P: pulumi/pulumi-${{matrix.provider}}
79+
V: ${{inputs.pulumi-java-version}}
80+
run: |
81+
cd provider
82+
upgrade-provider "$P" --kind=java --java-version="$V"
83+
84+
- name: Sleep to prevent hitting secondary rate limits
85+
run: sleep 1

0 commit comments

Comments
 (0)