Update Actions, require Go 1.22 to drop mux #150
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: Go CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-12, windows-latest] | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go >=1.22 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '>=1.22.0' | |
id: go | |
- name: Get dependencies | |
run: go get -v -t -d ./... | |
- name: Build | |
run: go build -ldflags="-s -w" -v . | |
# - name: Test | |
# run: go test -v . | |
- name: Set GOARCH=arm64 on macOS/Linux | |
if: ${{ success() && matrix.os != 'windows-latest' }} | |
run: echo "GOARCH=arm64" >> $GITHUB_ENV | |
- name: Set GOARCH=arm64 on Windows | |
if: ${{ success() && matrix.os == 'windows-latest' }} | |
run: echo "GOARCH=arm64" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Build ARMv8 binary | |
if: ${{ success() }} | |
run: go build -o ${{ matrix.os == 'windows-latest' && 'octyne-arm64.exe' || 'octyne-arm64' }} -ldflags="-s -w" -v . | |
- name: Build ARMv6 binary for Linux | |
if: ${{ success() && matrix.os == 'ubuntu-20.04' }} | |
run: GOARCH=arm GOARM=6 go build -o octyne-armv6 -ldflags="-s -w" -v . | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ success() }} | |
with: | |
name: octyne-${{ matrix.os }} | |
path: octyne* |