Skip to content

Commit eb9b8cf

Browse files
committed
Add gotools install action
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 0890559 commit eb9b8cf

File tree

5 files changed

+64
-16
lines changed

5 files changed

+64
-16
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Install Go Tools
2+
description: "Install Go Tools for pipeline"
3+
inputs:
4+
go-version:
5+
description: "Go version to install"
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Install Go ${{ inputs.go-version }}
11+
uses: actions/setup-go@v5
12+
with:
13+
go-version: ${{ inputs.go-version }}
14+
- name: Install project tools and dependencies
15+
shell: bash
16+
run: make project-tools

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
id-token: write
1313

1414
env:
15-
GO_VERSION: "1.23"
15+
GO_VERSION: "1.24"
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717

1818
jobs:
@@ -26,18 +26,18 @@ jobs:
2626
- name: Unshallow clone for tags
2727
run: git fetch --prune --unshallow --tags
2828

29-
- name: Install Go ${{ env.GO_VERSION }}
30-
uses: actions/setup-go@v5
31-
with:
32-
go-version: ${{ env.GO_VERSION }}
33-
3429
- name: Install pulumictl
3530
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
3631
with:
3732
repo: pulumi/pulumictl
3833

3934
- name: Install pulumi
4035
uses: pulumi/actions@v4
36+
37+
- name: Install Go Tools
38+
uses: ./.github/actions/gotools
39+
with:
40+
go-version: ${{ env.GO_VERSION }}
4141

4242
- name: Build sdks
4343
run: make build

.github/workflows/release.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
3333
- name: Unshallow clone for tags
3434
run: git fetch --prune --unshallow --tags
35-
- name: Install Go
36-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
37-
with:
38-
go-version: ${{matrix.goversion}}
3935
- name: Install pulumictl
4036
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
4137
with:
4238
repo: pulumi/pulumictl
39+
- name: Install Go Tools
40+
uses: ./.github/actions/gotools
41+
with:
42+
go-version: ${{ matrix.goversion }}
4343
- name: Set PreRelease Version
4444
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
4545
- uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
@@ -63,7 +63,7 @@ jobs:
6363
fail-fast: true
6464
matrix:
6565
goversion:
66-
- 1.22.x
66+
- 1.24.x
6767
publish_sdk:
6868
name: Publish SDKs
6969
runs-on: ubuntu-latest
@@ -73,16 +73,16 @@ jobs:
7373
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
7474
- name: Unshallow clone for tags
7575
run: git fetch --prune --unshallow --tags
76-
- name: Install Go
77-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
78-
with:
79-
go-version: ${{ matrix.goversion }}
8076
- name: Install pulumictl
8177
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
8278
with:
8379
repo: pulumi/pulumictl
8480
- name: Install Pulumi CLI
8581
uses: pulumi/action-install-pulumi-cli@b374ceb6168550de27c6eba92e01c1a774040e11 # tag=v2.0.0
82+
- name: Install Go Tools
83+
uses: ./.github/actions/gotools
84+
with:
85+
go-version: ${{ matrix.goversion }}
8686
- name: Setup Node
8787
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
8888
with:
@@ -132,7 +132,7 @@ jobs:
132132
dotnetversion:
133133
- 3.1.301
134134
goversion:
135-
- 1.22.x
135+
- 1.24.x
136136
language:
137137
- nodejs
138138
- python

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ NODE_MODULE_NAME := @pulumi/${PACK}
88
TF_NAME := ${PACK}
99
PROVIDER_PATH := provider
1010
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
11+
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
12+
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
1113

1214
JAVA_GEN := pulumi-java-gen
1315
JAVA_GEN_VERSION := v0.8.0
@@ -142,3 +144,10 @@ test::
142144

143145
fmt:
144146
@gofmt -s -w .
147+
148+
# SETUP AND TOOL INITIALIZATION TASKS
149+
project-help:
150+
@$(SCRIPTS_BASE)/project.sh help
151+
152+
project-tools:
153+
@$(SCRIPTS_BASE)/project.sh tools

scripts/project.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# This script is used to manage the project, only used for installing the required tools for now
4+
# Usage: ./project.sh [action]
5+
# * tools: Install required tools to run the project
6+
set -eo pipefail
7+
8+
ROOT_DIR_PROVIDER=$(git rev-parse --show-toplevel)/provider
9+
10+
action=$1
11+
12+
if [ "$action" = "help" ]; then
13+
[ -f "$0".man ] && man "$0".man || echo "No help, please read the script in ${script}, we will add help later"
14+
elif [ "$action" = "tools" ]; then
15+
cd ${ROOT_DIR_PROVIDER}
16+
17+
go mod download
18+
19+
go install github.com/golangci/golangci-lint/cmd/[email protected]
20+
go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]
21+
else
22+
echo "Invalid action: '$action', please use $0 help for help"
23+
fi

0 commit comments

Comments
 (0)