feat: use ko and publish multiarch images #43
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, pull_request] | |
jobs: | |
build: | |
name: Build for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
file: yeet-linux-amd64 | |
args: --best --lzma | |
strip: true | |
cgo: 0 | |
- os: windows-latest | |
file: yeet-win-amd64.exe | |
args: -9 | |
strip: false | |
cgo: 1 | |
- os: macos-latest | |
file: yeet-osx-amd64 | |
args: --best | |
strip: false | |
cgo: 1 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.20 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Build | |
run: go build -ldflags="-s -w" -v -o ${{ matrix.file }} . | |
env: | |
CGO_ENABLED: ${{ matrix.cgo }} | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.20 | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- run: git checkout HEAD^2 | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v1 | |
with: | |
languages: go | |
- name: Build | |
run: go build -ldflags="-s -w" -v -o yeet . | |
env: | |
CGO_ENABLED: 0 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v1 |