Move extra plugins to https://github.com/jonaharagon/caddy-build #17
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: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
build_from: | |
type: string | |
goos: | |
type: string | |
goarch: | |
type: string | |
go: | |
type: string | |
xcaddy_version: | |
type: string | |
env: | |
BUILD_FROM: ${{ inputs.build_from || '=./caddy-umami' }} | |
CGO_ENABLED: 0 | |
GOOS: ${{ inputs.goos || 'linux' }} | |
GOARCH: ${{ inputs.goarch || 'amd64' }} | |
XCADDY_VERSION: ${{ inputs.xcaddy_version || '0.3.5' }} | |
jobs: | |
build: | |
name: Build caddy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
path: caddy-umami | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ inputs.go || '~1.22.1' }} | |
cache: false | |
- name: Install xcaddy | |
run: | | |
wget https://github.com/caddyserver/xcaddy/releases/download/v${{ env.XCADDY_VERSION }}/xcaddy_${{ env.XCADDY_VERSION }}_linux_amd64.tar.gz | |
tar -xzvf xcaddy_${{ env.XCADDY_VERSION }}_linux_amd64.tar.gz | |
- name: Build Caddy | |
run: | | |
GOOS=$GOOS GOARCH=$GOARCH ./xcaddy build \ | |
--with github.com/jonaharagon/caddy-umami${{ env.BUILD_FROM }} | |
--output "caddy-$GOOS-$GOARCH" | |
- if: env.GOOS == 'linux' && env.GOARCH == 'amd64' | |
name: Show build info | |
run: | | |
./caddy-$GOOS-$GOARCH build-info | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: caddy-${{ env.GOOS }}-${{ env.GOARCH }} | |
path: caddy-${{ env.GOOS }}-${{ env.GOARCH }} |