32 lines
865 B
YAML
32 lines
865 B
YAML
name: Build Go Binary
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
source:
|
|
description: 'The source file to build'
|
|
required: false
|
|
type: string
|
|
default: './main.go'
|
|
target:
|
|
description: 'The output to store the build artifacts'
|
|
required: false
|
|
type: string
|
|
default: ./dist/main'
|
|
go-version:
|
|
description: 'The version of Go to use'
|
|
required: false
|
|
type: string
|
|
default: '>=1.23'
|
|
|
|
jobs:
|
|
build-go:
|
|
runs-on: docker
|
|
container:
|
|
image: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/pipeline-container/go:1.23
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/checkout@main
|
|
- name: Run go build
|
|
run: |
|
|
go build -o ${{ inputs.target }} ${{ inputs.source }}
|