diff --git a/.gitignore b/.gitignore index 8ab4af6..8810971 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ # Generated by Go coverage. *.out + +# Generated by GoReleaser. +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..f56b9fc --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,11 @@ +version: 1 + +builds: + - id: starling-bank-technical-challenge + main: ./cmd/starling-bank-technical-challenge + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin diff --git a/ci/check-yaml-formatting.sh b/ci/check-yaml-formatting.sh index d39cb5a..40405f3 100755 --- a/ci/check-yaml-formatting.sh +++ b/ci/check-yaml-formatting.sh @@ -1,6 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -o errexit set -o xtrace -yamlfmt -lint -dstar .github/**/* +yamlfmt -lint -dstar .github/**/* .goreleaser.yaml diff --git a/ci/fix-yaml-formatting.sh b/ci/fix-yaml-formatting.sh index 7f5c712..ab0eeb9 100755 --- a/ci/fix-yaml-formatting.sh +++ b/ci/fix-yaml-formatting.sh @@ -3,4 +3,4 @@ set -o errexit set -o xtrace -yamlfmt -dstar ./github/**/* +yamlfmt -dstar ./github/**/* .goreleaser.yaml diff --git a/ci/release-artifacts.sh b/ci/release-artifacts.sh new file mode 100755 index 0000000..3c7a8b7 --- /dev/null +++ b/ci/release-artifacts.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +set -o errexit +set -o xtrace + +# Iterate through the array +for row in $(jq -c '.[]' "dist/artifacts.json"); do + path=$(echo "${row}" | jq -r '.path') + name=$(echo "${path}" | cut -d '/' -f 2) + + echo "${name} ${path}" +done