chore: update actions/checkout action to v4.1.3 (#97) #210
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: build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64] | |
steps: | |
- uses: actions/[email protected] | |
- name: setup golang | |
uses: actions/[email protected] | |
with: | |
go-version-file: "go.mod" | |
- name: add build file suffix | |
if: ${{ matrix.goos == 'windows' }} | |
run: echo "SUFFIX=.exe" >> $GITHUB_ENV | |
- name: build project | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
run: go build -o build/monstercat_${{ matrix.goos }}_${{ matrix.goarch }}${{ env.SUFFIX }} main.go | |
- name: store binary | |
uses: actions/[email protected] | |
with: | |
name: ${{ matrix.goos }}_${{ matrix.goarch }} | |
path: build/ | |
release: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: download all binaries | |
uses: actions/[email protected] | |
with: | |
path: build/ | |
- name: upload artifacts to release | |
uses: softprops/[email protected] | |
with: | |
files: build/**/* |