Skip to content

Artifactory upload. (#6) #32

Artifactory upload. (#6)

Artifactory upload. (#6) #32

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: Build get-zap
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build local
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
build-all:
name: Build all binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Build get-zap for a given architecture
run: GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} go build -o bin/get-zap-${{matrix.goos}}-${{matrix.goarch}}${{matrix.goos == 'windows' && '.exe' || ''}}
- name: Strip Linux and Windows binaries
if: matrix.goos != 'darwin' && matrix.goarch != 'arm64'
run: strip bin/get-zap-${{matrix.goos}}-${{matrix.goarch}}${{matrix.goos == 'windows' && '.exe' || ''}}
- name: Archive the binary
uses: actions/upload-artifact@v4
with:
name: get-zap-${{matrix.goos}}-${{matrix.goarch}}${{matrix.goos == 'windows' && '.exe' || ''}}
path: bin/get-zap-${{matrix.goos}}-${{matrix.goarch}}${{matrix.goos == 'windows' && '.exe' || ''}}