-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.17 KB
/
reusable-build-golang-alpine.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Reusable workflow for build golang on alpine
on:
workflow_call:
inputs:
make_command:
type: string
default: restore
use_artifacts:
type: boolean
default: false
binary_name:
type: string
default: mdrop
binary_os:
type: string
default: linux
binary_arch:
type: string
default: amd64
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker.io/library/golang:alpine
steps:
- name: Check Out Repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install cgo + make Dependencies
run: |
apk update
apk add make gcc musl-dev
- name: Build app
run: make BINARY_SUFFIX=-${{ inputs.binary_os }}-${{ inputs.binary_arch }} ${{ inputs.make_command }}
- name: Upload artifacts
if: ${{ inputs.use_artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.binary_name }}-${{ inputs.binary_os }}-${{ inputs.binary_arch }}-artifact
path: ./${{ inputs.binary_name }}-${{ inputs.binary_os }}-${{ inputs.binary_arch }}