Skip to content

Release binaries

Release binaries #1

name: Release binaries
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- { goos: aix, goarch: ppc64 }
- { goos: darwin, goarch: amd64 }
- { goos: darwin, goarch: arm64 }
- { goos: dragonfly, goarch: amd64 }
- { goos: freebsd, goarch: 386 }
- { goos: freebsd, goarch: amd64 }
- { goos: freebsd, goarch: arm }
- { goos: freebsd, goarch: arm64 }
- { goos: illumos, goarch: amd64 }
- { goos: linux, goarch: 386 }
- { goos: linux, goarch: amd64 }
- { goos: linux, goarch: arm }
- { goos: linux, goarch: arm64 }
- { goos: linux, goarch: mips }
- { goos: linux, goarch: mips64 }
- { goos: linux, goarch: mips64le }
- { goos: linux, goarch: mipsle }
- { goos: linux, goarch: ppc64 }
- { goos: linux, goarch: ppc64le }
- { goos: linux, goarch: riscv64 }
- { goos: linux, goarch: s390x }
- { goos: netbsd, goarch: 386 }
- { goos: netbsd, goarch: amd64 }
- { goos: netbsd, goarch: arm }
- { goos: netbsd, goarch: arm64 }
- { goos: openbsd, goarch: 386 }
- { goos: openbsd, goarch: amd64 }
- { goos: openbsd, goarch: arm }
- { goos: openbsd, goarch: arm64 }
- { goos: solaris, goarch: amd64 }
- { goos: windows, goarch: 386 }
- { goos: windows, goarch: amd64 }
- { goos: windows, goarch: arm }
- { goos: windows, goarch: arm64 }
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
- name: Build binaries
run: |
mkdir -p dist
FILENAME=pagespeed_exporter-${{ matrix.platform.goos }}-${{ matrix.platform.goarch }}
if [[ "${{ matrix.platform.goos }}" == "windows" ]]; then
FILENAME=$FILENAME.exe
fi
GOOS=${{ matrix.platform.goos }} GOARCH=${{ matrix.platform.goarch }} go build -ldflags "-X main.Version=`git rev-parse --short HEAD`" -o dist/$FILENAME
- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
files: dist/pagespeed_exporter-${{ matrix.platform.goos }}-${{ matrix.platform.goarch }}${{ matrix.platform.goos == 'windows' && '.exe' || '' }}