build/build-go.md
Kai Reichart 5ca206e3ba
All checks were successful
/ test_build_docker (push) Successful in 10s
/ test_build_go (push) Successful in 8s
fixed path
2024-11-28 14:10:23 +01:00

25 lines
992 B
Markdown

# Build Go Forgejo Action
This Action builds a Go application. It compiles the specified Go source file and outputs the build artifacts to a target directory.
## Inputs
| Input Name | Description | Required | Type | Default Value |
|-------------|-------------------------------------|----------|--------|-------------------------|
| `source` | The path to the Go source file to build. | No | string | `./main.go` |
| `target` | The output path for build artifacts. | No | string | `./dist/main` |
| `go-version`| The Go version to use. | No | string | `>=1.23` |
## Usage
This action can be called from other workflows using `workflow_call`. Below is an example of how to invoke it:
```yaml
jobs:
build:
uses: DevFW-CICD/build/.github/workflows/build-go.yml@main
with:
source: './cmd/app/main.go'
target: './build/app'
go-version: '1.19'
```