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