forked from caddyserver/forwardproxy
-
Notifications
You must be signed in to change notification settings - Fork 101
38 lines (38 loc) · 1.23 KB
/
build.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
name: Build
on:
push:
branches: [naive]
paths-ignore: [README.md]
release:
types: [published]
defaults:
run:
shell: bash
jobs:
build_caddy_with_naive:
runs-on: ubuntu-22.04
env:
BUNDLE: caddy-forwardproxy-naive
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ^1.21.9
- run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
- run: ~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@master=$PWD
- name: Pack naiveproxy assets
run: |
mkdir ${{ env.BUNDLE }}
cp caddy LICENSE README.md ${{ env.BUNDLE }}
tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }}
openssl sha256 ./caddy >sha256sum.txt
echo "SHA256SUM=$(cut -d' ' -f2 sha256sum.txt)" >>$GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.BUNDLE }}.tar.xz caddy executable sha256 ${{ env.SHA256SUM }}
path: sha256sum.txt
- name: Upload caddy assets
if: ${{ github.event_name == 'release' }}
run: gh release upload "${GITHUB_REF##*/}" ${{ env.BUNDLE }}.tar.xz --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}