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:
|
|
|
|
cross-build-test:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-22 12:00:48 +08:00
|
|
|
goos:
|
|
|
|
- 'android'
|
|
|
|
- 'linux'
|
|
|
|
- 'solaris'
|
|
|
|
- 'illumos'
|
|
|
|
- 'dragonfly'
|
|
|
|
- 'freebsd'
|
|
|
|
- 'openbsd'
|
|
|
|
- 'plan9'
|
|
|
|
- 'windows'
|
|
|
|
- 'darwin'
|
|
|
|
- 'netbsd'
|
|
|
|
go:
|
2023-08-10 00:34:28 +08:00
|
|
|
- '1.21'
|
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 }}
|
2023-08-10 00:34:28 +08:00
|
|
|
- go: '1.21'
|
|
|
|
GO_SEMVER: '~1.21.0'
|
2022-04-14 04:03:38 +08:00
|
|
|
|
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
|
2023-04-02 12:36:16 +08:00
|
|
|
uses: actions/setup-go@v4
|
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 }}
|
|
|
|
shell: bash
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: ./cmd/caddy
|
|
|
|
run: |
|
|
|
|
GOOS=$GOOS go build -trimpath -o caddy-"$GOOS"-amd64 2> /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "::warning ::$GOOS Build Failed"
|
|
|
|
exit 0
|
|
|
|
fi
|