Skip to content

minor: v0.4.0

minor: v0.4.0 #27

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goosarch:
- 'darwin/arm64'
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install utilities
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go get -u github.com/mitchellh/gox
go install github.com/tcnksm/ghr@latest
go install github.com/stevenmatthewt/semantics@latest
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=hl-bot-$GOOS-$GOARCH
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: go build -o "$BINARY_NAME" .
- name: Publish release
run: |
echo $PATH
export PATH=${PATH}:`go env GOPATH`/bin
tag=$(semantics --output-tag)
if [ "$tag" ]; then
ghr -t {{ secrets.RELEASE_TOKEN }} -u jhalter -r hotline-ai-chat-bot --replace $tag dist/
else
echo "The commit message(s) did not indicate a major/minor/patch version."
fi