Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 01:00 UTC
| 1 | name: Cross-Build |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | - 2.* |
| 8 | pull_request: |
| 9 | branches: |
| 10 | - master |
| 11 | - 2.* |
| 12 | |
| 13 | env: |
| 14 | GOFLAGS: '-tags=nobadger,nomysql,nopgx' |
| 15 | CGO_ENABLED: '0' |
| 16 | # https://github.com/actions/setup-go/issues/491 |
| 17 | GOTOOLCHAIN: local |
| 18 | |
| 19 | permissions: |
| 20 | contents: read |
| 21 | |
| 22 | jobs: |
| 23 | build: |
| 24 | strategy: |
| 25 | fail-fast: false |
| 26 | matrix: |
| 27 | goos: |
| 28 | - 'aix' |
| 29 | - 'linux' |
| 30 | - 'solaris' |
| 31 | - 'illumos' |
| 32 | - 'dragonfly' |
| 33 | - 'freebsd' |
| 34 | - 'openbsd' |
| 35 | - 'windows' |
| 36 | - 'darwin' |
| 37 | - 'netbsd' |
| 38 | go: |
| 39 | - '1.26' |
| 40 | |
| 41 | include: |
| 42 | # Set the minimum Go patch version for the given Go minor |
| 43 | # Usable via ${{ matrix.GO_SEMVER }} |
| 44 | - go: '1.26' |
| 45 | GO_SEMVER: '~1.26.0' |
| 46 | |
| 47 | runs-on: ubuntu-latest |
| 48 | permissions: |
| 49 | contents: read |
| 50 | pull-requests: read |
| 51 | continue-on-error: true |
| 52 | steps: |
| 53 | - name: Harden the runner (Audit all outbound calls) |
| 54 | uses: step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3 |
| 55 | with: |
| 56 | egress-policy: audit |
| 57 | |
| 58 | - name: Checkout code |
| 59 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 60 | |
| 61 | - name: Install Go |
| 62 | uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 |
| 63 | with: |
| 64 | go-version: ${{ matrix.GO_SEMVER }} |
| 65 | check-latest: true |
| 66 | |
| 67 | - name: Print Go version and environment |
| 68 | id: vars |
| 69 | run: | |
| 70 | printf "Using go at: $(which go)\n" |
| 71 | printf "Go version: $(go version)\n" |
| 72 | printf "\n\nGo environment:\n\n" |
| 73 | go env |
| 74 | printf "\n\nSystem environment:\n\n" |
| 75 | env |
| 76 | |
| 77 | - name: Run Build |
| 78 | env: |
| 79 | GOOS: ${{ matrix.goos }} |
| 80 | GOARCH: ${{ matrix.goos == 'aix' && 'ppc64' || 'amd64' }} |
| 81 | shell: bash |
| 82 | continue-on-error: true |
| 83 | working-directory: ./cmd/caddy |
| 84 | run: go build -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null |