Skip to content

Commit

Permalink
Fix action errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dvasanth authored Apr 22, 2024
1 parent 7afa671 commit 05af354
Showing 1 changed file with 46 additions and 33 deletions.
79 changes: 46 additions & 33 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
# 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: [ "main" ]
branches: [main]
pull_request:
branches: [ "main" ]
branches: [main]

name: Build

defaults:
run:
shell: bash

jobs:
lint:
name: Lint files
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest
build:
name: Build binary
runs-on: ubuntu-latest
runs-on: 'ubuntu-latest'
strategy:
matrix:
goosarch:
- 'darwin/amd64'
- 'darwin/arm64'
- 'linux/386'
- 'linux/amd64'
- 'windows/amd64'
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=${{github.repository}}-$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" -v
matrix:
goosarch:
- 'darwin/amd64'
- 'darwin/arm64'
- 'linux/386'
- 'linux/amd64'
- 'windows/amd64'
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=${{github.repository}}-$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" -v

0 comments on commit 05af354

Please sign in to comment.