Allow workflow to run on experimental branch #69
This file contains hidden or 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: | |
| push: | |
| branches: [naive, naive-master] | |
| paths-ignore: [README.md] | |
| release: | |
| types: [published] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build_caddy_with_naive: | |
| strategy: | |
| matrix: | |
| target_os: [linux] | |
| target_arch: [amd64, arm64] | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE: caddy-forwardproxy-naive-${{ matrix.target_os }}-${{ matrix.target_arch }} | |
| 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: GOOS=${{ matrix.target_os }} GOARCH=${{ matrix.target_arch }} ~/go/bin/xcaddy build master --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 }} |