-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (107 loc) · 3.53 KB
/
Build Caddy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Build Caddy
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: "windows-arm64",
GOARCH: arm64,
GOOS: windows,
release: true
}
- {
name: "windows-amd64",
GOARCH: amd64,
GOOS: windows,
release: true
}
- {
name: "linux-amd64",
GOARCH: amd64,
GOOS: linux,
release: true
}
- {
name: "linux-arm64",
GOARCH: arm64,
GOOS: linux,
release: true
}
- {
name: "darwin-amd64",
GOARCH: amd64,
GOOS: darwin,
release: true
}
- {
name: "darwin-arm64",
GOARCH: arm64,
GOOS: darwin,
release: true
}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install go
uses: actions/setup-go@v3
with:
go-version: '1.21'
check-latest: true
- name: Install xcaddy
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
- name: Build caddy
if: matrix.config.GOOS == 'windows'
run: |
mkdir release-tmp
export version=$(curl -s "https://api.github.com/repos/caddyserver/caddy/releases/latest" | jq -r .tag_name)
export GOARCH=${{ matrix.config.GOARCH }}
export GOOS=${{ matrix.config.GOOS }}
~/go/bin/xcaddy build \
--with github.com/mholt/caddy-l4 \
--with github.com/caddy-dns/cloudflare \
--with clevergo.tech/caddy-dnspodcn \
--with github.com/caddy-dns/duckdns \
--with github.com/mholt/caddy-dynamicdns \
--with github.com/mholt/caddy-events-exec \
--with github.com/WeidiDeng/caddy-cloudflare-ip \
--with github.com/caddyserver/forwardproxy@caddy2 \
--with github.com/imgk/caddy-trojan \
--with github.com/mholt/caddy-webdav \
--output ./release-tmp/caddy_${version}_${{ matrix.config.name }}.exe
- name: Build caddy
if: matrix.config.GOOS != 'windows'
run: |
mkdir release-tmp
export version=$(curl -s "https://api.github.com/repos/caddyserver/caddy/releases/latest" | jq -r .tag_name)
export GOARCH=${{ matrix.config.GOARCH }}
export GOOS=${{ matrix.config.GOOS }}
~/go/bin/xcaddy build \
--with github.com/mholt/caddy-l4 \
--with github.com/caddy-dns/cloudflare \
--with clevergo.tech/caddy-dnspodcn \
--with github.com/caddy-dns/duckdns \
--with github.com/mholt/caddy-dynamicdns \
--with github.com/mholt/caddy-events-exec \
--with github.com/WeidiDeng/caddy-cloudflare-ip \
--with github.com/caddyserver/forwardproxy@caddy2 \
--with github.com/imgk/caddy-trojan \
--with github.com/mholt/caddy-webdav \
--output ./release-tmp/caddy_${version}_${{ matrix.config.name }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
name: caddy-${{ github.sha }}-${{ matrix.config.name }}
path: ./release-tmp/*
- name: Upload to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./release-tmp/*
tag: Caddy2
overwrite: true
file_glob: true