add cli artifact build to workflow #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Build | |
on: [push] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
include: | |
- os: windows-latest | |
artifact: bucket.exe | |
filename: bucket.exe | |
- os: ubuntu-latest | |
artifact: bucket | |
filename: bucket/bucket | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go 1.21.x | |
uses: actions/setup-go@v5 | |
with: | |
# Semantic version range syntax or exact version of Go | |
go-version: '1.21.x' | |
cache: true | |
- name: Install dependencies | |
run: go get . | |
- name: Build | |
run: go build -v -o ${{ matrix.artifact }} | |
- name: Test | |
run: go test -v | |
- name: Log files | |
run: | | |
ls ${{ github.workspace }} | |
- name: Upload binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact }} | |
path: ${{ matrix.filename }} |