Add build workflow
This commit is contained in:
parent
8563441787
commit
d62c80d3dd
1 changed files with 38 additions and 0 deletions
38
.github/workflows/build.yml
vendored
Normal file
38
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,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 }}
|
||||||
Loading…
Add table
Reference in a new issue