2020-08-01 23:23:22 +03:00
|
|
|
name: Cross-Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-12 07:26:16 +03:00
|
|
|
- 2.*
|
2020-08-01 23:23:22 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-12 07:26:16 +03:00
|
|
|
- 2.*
|
2020-08-01 23:23:22 +03:00
|
|
|
|
|
|
|
jobs:
|
2024-02-10 01:31:26 +03:00
|
|
|
build:
|
2020-08-01 23:23:22 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-22 07:00:48 +03:00
|
|
|
goos:
|
2023-12-11 15:55:04 +03:00
|
|
|
- 'aix'
|
2023-07-22 07:00:48 +03:00
|
|
|
- 'linux'
|
|
|
|
- 'solaris'
|
|
|
|
- 'illumos'
|
|
|
|
- 'dragonfly'
|
|
|
|
- 'freebsd'
|
|
|
|
- 'openbsd'
|
|
|
|
- 'windows'
|
|
|
|
- 'darwin'
|
|
|
|
- 'netbsd'
|
|
|
|
go:
|
2024-01-25 21:58:19 +03:00
|
|
|
- '1.22'
|
2024-08-23 20:01:28 +03:00
|
|
|
- '1.23'
|
2022-04-13 23:03:38 +03:00
|
|
|
|
|
|
|
include:
|
|
|
|
# Set the minimum Go patch version for the given Go minor
|
|
|
|
# Usable via ${{ matrix.GO_SEMVER }}
|
2024-01-25 21:58:19 +03:00
|
|
|
- go: '1.22'
|
2024-05-10 17:56:18 +03:00
|
|
|
GO_SEMVER: '~1.22.3'
|
2022-04-13 23:03:38 +03:00
|
|
|
|
2024-08-23 20:01:28 +03:00
|
|
|
- go: '1.23'
|
|
|
|
GO_SEMVER: '~1.23.0'
|
|
|
|
|
2020-08-01 23:23:22 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2023-04-15 04:38:33 +03:00
|
|
|
- name: Checkout code
|
2023-10-02 03:13:54 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-04-15 04:38:33 +03:00
|
|
|
|
2020-08-01 23:23:22 +03:00
|
|
|
- name: Install Go
|
2024-01-02 10:13:31 +03:00
|
|
|
uses: actions/setup-go@v5
|
2020-08-01 23:23:22 +03:00
|
|
|
with:
|
2022-04-13 23:03:38 +03:00
|
|
|
go-version: ${{ matrix.GO_SEMVER }}
|
|
|
|
check-latest: true
|
2020-08-21 05:40:26 +03:00
|
|
|
|
2020-08-01 23:23:22 +03:00
|
|
|
- name: Print Go version and environment
|
|
|
|
id: vars
|
|
|
|
run: |
|
|
|
|
printf "Using go at: $(which go)\n"
|
|
|
|
printf "Go version: $(go version)\n"
|
|
|
|
printf "\n\nGo environment:\n\n"
|
|
|
|
go env
|
|
|
|
printf "\n\nSystem environment:\n\n"
|
|
|
|
env
|
2020-08-21 05:40:26 +03:00
|
|
|
|
2020-08-01 23:23:22 +03:00
|
|
|
- name: Run Build
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: ${{ matrix.goos }}
|
2023-12-11 15:55:04 +03:00
|
|
|
GOARCH: ${{ matrix.goos == 'aix' && 'ppc64' || 'amd64' }}
|
2020-08-01 23:23:22 +03:00
|
|
|
shell: bash
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: ./cmd/caddy
|
|
|
|
run: |
|
2024-10-22 23:53:14 +03:00
|
|
|
GOOS=$GOOS GOARCH=$GOARCH go build -tags=nobadger,nomysql,nopgx -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null
|