From c45f239511280aad15631eeb377d93b7933bf02f Mon Sep 17 00:00:00 2001 From: Oscar Cobles Date: Wed, 18 Sep 2024 18:20:00 +0200 Subject: [PATCH] chore: unify setup-go and golang version Signed-off-by: Oscar Cobles --- .github/actions/setup-tools/action.yml | 2 +- .github/actions/upgrade-provider/action.yml | 112 -------------------- .github/workflows/lint.yml | 5 +- .github/workflows/release.yml | 9 +- .github/workflows/run-acceptance-tests.yml | 13 ++- 5 files changed, 13 insertions(+), 128 deletions(-) delete mode 100644 .github/actions/upgrade-provider/action.yml diff --git a/.github/actions/setup-tools/action.yml b/.github/actions/setup-tools/action.yml index c90bb735..a10139a4 100644 --- a/.github/actions/setup-tools/action.yml +++ b/.github/actions/setup-tools/action.yml @@ -22,7 +22,7 @@ runs: if: inputs.tools == 'all' || contains(inputs.tools, 'go') uses: actions/setup-go@v5 with: - go-version: "1.22.x" + go-version-file: provider/go.mod cache-dependency-path: | provider/*.sum upstream/*.sum diff --git a/.github/actions/upgrade-provider/action.yml b/.github/actions/upgrade-provider/action.yml deleted file mode 100644 index 22cd6c22..00000000 --- a/.github/actions/upgrade-provider/action.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: 'Upgrade provider' -description: 'An action to upgrade bridged providers' -inputs: - kind: - description: The kind of upgrade to perform; valid options are ["all", "provider", "bridge"] - required: true - default: "all" - username: - description: 'The username for git configuration' - required: false - default: ${{ github.actor }} - email: - description: 'The email for git configuration' - required: false - automerge: - description: 'If the created PR should be auto-merged' - required: false - default: false - pr-assign: - description: 'A user to assign the upgrade PR to' - required: false - default: "" - pr-reviewers: - description: | - Handles of reviewers to assign the created PRs to. If empty, default reviewers are assigned. - required: false - default: "" - pr-description: - description: | - Extra description to insert in the auto-generated pull request. - required: false - default: "" - pr-title-prefix: - description: | - Prefix to add to the title of the auto-generated pull request. - required: false - default: "" - target-bridge-version: - description: | - Informs which version of pulumi-terraform-bridge to target for updating the bridge; valid - options are "latest", a version like "1.2.3", or a Git commit hash reference like "cad926a2d". - required: false - default: "latest" - target-pulumi-version: - description: | - Set the version of `pulumi/pkg` and `pulumi/sdk` to depend on for bridged providers. Currently, - these versions inform the linked runtime and SDK generation in all languages except Java. Valid - options are: - - "", "follow": Use the same version as pulumi-terraform-bridge - - A go version such as "v3.90.1" - - A commit SHA in pulumi/pulumi such as "ac71ebc1d34e5ccfd1a7fed61e6ff43a3160f3cb" - required: false - default: "" - target-java-version: - description: | - Explicitly set the version pf pulumi/pulumi-java to generate the java sdk with. - required: false - default: "" -runs: - using: "composite" - steps: - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: 1.22.x - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.10.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - shell: bash - - name: Install upgrade-provider - run: go install github.com/pulumi/upgrade-provider@main - shell: bash - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: "7.6" - - name: "Set up git identity: name" - run: git config --global user.name '${{ inputs.username }}' - shell: bash - - name: "Set up git identity: email" - if: ${{ inputs.email != '' }} - run: git config --global user.email '${{ inputs.email }}' - shell: bash - - name: Run upgrade-provider - run: | - upgrade-provider "$REPO" --kind="$KIND" ${TBV:+--target-bridge-version="$TBV"} ${ASS:+--pr-assign="$ASS"} ${REV:+--pr-reviewers="$REV"} ${DESC:+--pr-description="$DESC"} ${PREF:+--pr-title-prefix="$PREF"} ${PUV:+--target-pulumi-version="$PUV"} ${JV:+--java-version="$JV"} - shell: bash - env: - GH_TOKEN: ${{ env.GH_TOKEN }} - REPO: ${{ github.repository }} - KIND: ${{ inputs.kind }} - TBV: ${{ inputs.target-bridge-version }} - ASS: ${{ inputs.pr-assign }} - REV: ${{ inputs.pr-reviewers }} - DESC: ${{ inputs.pr-description }} - PREF: ${{ inputs.pr-title-prefix }} - PUV: ${{ inputs.target-pulumi-version }} - JV: ${{ inputs.target-java-version }} - - name: Set PR to auto-merge - if: ${{ inputs.automerge == 'true' }} - # This tolerates repos that do not have auto-merge enabled. `continue-on-error: true` - # should be removed when https://github.com/pulumi/home/issues/3140 closes. - continue-on-error: true - run: gh pr merge --auto --squash --delete-branch - shell: bash - env: - GH_TOKEN: ${{ env.GH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 213b6feb..201aea0e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,6 @@ on: inputs: {} env: DOTNETVERSION: 7.0.x - GOVERSION: 1.22.x JAVAVERSION: "11" NODEVERSION: 20.x PYTHONVERSION: "3.9" @@ -22,10 +21,10 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - name: Install go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: # The versions of golangci-lint and setup-go here cross-depend and need to update together. - go-version: 1.21 + go-version-file: provider/go.mod # Either this action or golangci-lint needs to disable the cache cache: false - name: disarm go:embed directives to enable lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f2d6967..d878a8e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ on: env: PROVIDER: equinix DOTNETVERSION: 7.0.x - GOVERSION: 1.22.x GRADLEVERSION: "7.6" JAVAVERSION: "11" NODEVERSION: 20.x @@ -53,9 +52,9 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GOVERSION }} + go-version-file: provider/go.mod - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -105,9 +104,9 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GOVERSION }} + go-version-file: provider/go.mod - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.10.0 with: diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index 7293422d..d36314ea 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -16,7 +16,6 @@ env: PROVIDER: equinix PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} DOTNETVERSION: 7.0.x - GOVERSION: 1.22.x JAVAVERSION: "11" NODEVERSION: 20.x PYTHONVERSION: "3.9" @@ -43,11 +42,11 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: cache-dependency-path: | sdk/go.sum - go-version: 1.21.x + go-version-file: provider/go.mod - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -160,11 +159,11 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: cache-dependency-path: | sdk/go.sum - go-version: 1.21.x + go-version-file: provider/go.mod - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -285,11 +284,11 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: cache-dependency-path: | sdk/go.sum - go-version: 1.21.x + go-version-file: provider/go.mod - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.10.0 with: