Skip to content

Commit

Permalink
adjust file names
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Lewis <[email protected]>
  • Loading branch information
ianlewis committed Feb 28, 2023
1 parent 84a2ad4 commit b1dcdb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/configs-go/config-ldflags-workflow_dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Used for e2e tests.
# TODO: update with various config parameters.
version: 1
env:
- GO111MODULE=on
- CGO_ENABLED=0

flags:
- -trimpath
- -tags=netgo

goos: linux
goarch: amd64
binary: gha_go-binary-{{ .Os }}-{{ .Arch }}-workflow_dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ jobs:
run: |
if [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then
echo "::set-output name=binary-name::gha_generic-binary-linux-amd64-workflow_dispatch"
echo "::set-output name=config-file::.github/configs-go/config-ldflags-workflow_dispatch.yml"
exit 0
fi
# This must be a tag event.
echo "::set-output name=binary-name::gha_generic-binary-linux-amd64-${GITHUB_REF_NAME}"
echo "::set-output name=config-file::.github/configs-go/config-ldflags-tag-name.yml"
build:
needs: generate_name
needs: [generate_name]
env:
BINARY_NAME: ${{ needs.generate_name.outputs.binary-name }}
outputs:
Expand Down Expand Up @@ -87,6 +89,7 @@ jobs:
upload-assets: true

gha_go:
needs: [generate_name]
permissions:
id-token: write # For signing.
contents: write # For asset uploads.
Expand All @@ -95,7 +98,7 @@ jobs:
with:
go-version: 1.18
# We cannot use ${{ env.CONFIG_FILE }} because env variables are not available.
config-file: .github/configs-go/config-ldflags-tag-name.yml
config-file: ${{ needs.generate_name.outputs.config-file }}

container_build:
env:
Expand Down

0 comments on commit b1dcdb9

Please sign in to comment.