Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-12-14 22:14:19 +01:00
commit 20f86c17af
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 210 additions and 0 deletions

View file

@ -0,0 +1,43 @@
on:
workflow_call:
inputs:
tag:
required: true
type: string
goos:
required: true
type: string
goarch:
required: true
type: string
binari:
required: true
type: string
jobs:
build:
runs-on: docker
env:
RELEASE_CIBLE: ${{ inputs.tag }}
GOOS: ${{ inputs.goos }}
GOARCH: ${{ inputs.goarch }}
BINARI: ${{ inputs.binari }}
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Build du projet
run: |
echo "Building for ${BINARI}/${GOOS}/${GOARCH} (release: ${RELEASE_CIBLE})"
go env GOOS GOARCH
mkdir -p dist/
go build -o dist/${BINARI}_${GOOS}_${GOARCH} ./cmd/${BINARI}
echo "artifact pour ${RELEASE_CIBLE} ${BINARI} ${GOOS} ${GOARCH}" > dist/${BINARI}-${GOOS}-${GOARCH}.txt
ls -l ./dist
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BINARI }}-${{ env.RELEASE_CIBLE }}-${{ env.GOOS }}-${{ env.GOARCH }}
path: dist/${{ env.BINARI }}_${{ env.GOOS }}_${{ env.GOARCH }}