2023-07-12 23:10:34 +00:00
|
|
|
name: reusable-dev-build
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
uploaded-binary-name:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: "consul-bin"
|
|
|
|
runs-on:
|
|
|
|
description: An expression indicating which kind of runners to use.
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-04-05 15:58:00 +00:00
|
|
|
go-arch:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: ""
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token:
|
|
|
|
required: true
|
2023-03-28 21:29:27 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ fromJSON(inputs.runs-on) }}
|
|
|
|
steps:
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2023-03-30 16:57:11 +00:00
|
|
|
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
|
|
|
|
- name: Setup Git
|
|
|
|
if: ${{ endsWith(inputs.repository-name, '-enterprise') }}
|
|
|
|
run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com"
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Build
|
2023-04-05 15:58:00 +00:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ inputs.goarch }}
|
2023-03-28 21:29:27 +00:00
|
|
|
run: make dev
|
|
|
|
# save dev build to pass to downstream jobs
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
name: ${{inputs.uploaded-binary-name}}
|
|
|
|
path: ./bin/consul
|
|
|
|
- name: Notify Slack
|
2023-03-30 16:57:11 +00:00
|
|
|
if: ${{ failure() }}
|
2023-03-28 21:29:27 +00:00
|
|
|
run: .github/scripts/notify_slack.sh
|