Skip to content

Commit 77e72f9

Browse files
committed
auto setup go
1 parent 3452daf commit 77e72f9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

action.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inputs:
4848
required: false
4949
default: 'latest'
5050
build_from_source:
51-
description: 'Build holon from source before running (default: false, download from releases). Requires Go toolchain - add "actions/setup-go@v5" step before this action when enabled.'
51+
description: 'Build holon from source before running (default: false, download from releases). When enabled, this action will set up Go automatically.'
5252
required: false
5353
default: 'false'
5454
holon_repository:
@@ -112,16 +112,18 @@ runs:
112112
repository: ${{ inputs.holon_repository }}
113113
path: holon-source
114114

115+
- name: Setup Go (for building)
116+
if: inputs.build_from_source == 'true'
117+
uses: actions/setup-go@v5
118+
with:
119+
go-version-file: holon-source/go.mod
120+
cache: true
121+
cache-dependency-path: holon-source/go.sum
122+
115123
- name: Build from source (if enabled)
116124
if: inputs.build_from_source == 'true'
117125
shell: bash
118126
run: |
119-
# Setup Go if needed
120-
if ! command -v go &> /dev/null; then
121-
echo "Error: Go not found. Please add 'actions/setup-go@v5' before this action when build_from_source is true."
122-
exit 1
123-
fi
124-
125127
# Build in separate directory
126128
cd holon-source
127129
echo "Building holon from source..."

0 commit comments

Comments
 (0)