bin-caddy/.forgejo/workflows/Build Caddy.yml
GregoryDosh 0b7caa6c55
Some checks failed
Build Caddy / Build Caddy (push) Has been cancelled
Initial Dosh LLC Config 🌈🐻
2025-11-24 13:09:08 -06:00

93 lines
2.8 KiB
YAML

# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Dosh LLC
---
name: Build Caddy
on:
push:
branches:
- "main"
pull_request:
jobs:
build-caddy:
name: Build Caddy
runs-on: ubuntu-act-latest
if: secrets.REPO_PUBLISH_TOKEN != ''
steps:
- name: Clone Repo into Workspace
uses: https://git.auengun.net/homelab/action-common-setup@3e92f643023a84a6b2bdc495a271846c5e98c949 # 1.5.0
- name: Create Release Title
run: |
{
printf "RELEASE_TITLE="
cat go.mod | grep caddyserver/caddy | cut -f 2 -d" " | tr -d '\n'
echo -n "-${{ env.GITHUB_RUN_NUMBER }}-${{ github.sha }}" | cut -c1-9
} >> "$GITHUB_ENV"
- name: Vet License & Vulnerabilities
id: make_vet
shell: bash
run: |
set +e
make clean vet 2>&1 | tee vet.log
RESULT="$?"
set -e
{
echo ""
echo "<details open>"
echo ""
echo "<summary>## License & Vulnerability Scan</summary>"
echo ""
echo "\`\`\`shell"
cat vet.log
echo "\`\`\`"
echo ""
echo "</details>"
} 2>&1 >> "${{ github.workspace }}/.pr-comment.md"
echo "Saved to '${{ github.workspace }}/.pr-comment.md'"
exit $RESULT
- name: Build Caddy
id: make_build
shell: bash
run: |
set +e
make build 2>&1 | tee build.log
RESULT="$?"
set -e
{
echo "# Caddy ${{ env.RELEASE_TITLE }}"
echo ""
echo "<details>"
echo ""
echo "<summary>## Build Log</summary>"
echo ""
echo "\`\`\`shell"
cat build.log
echo "\`\`\`"
echo ""
echo "</details>"
} 2>&1 >> "${{ github.workspace }}/.pr-comment.md"
echo "Saved to '${{ github.workspace }}/.pr-comment.md'"
exit $RESULT
- name: Post/Update PR Comment
if: ${{ github.event_name == 'pull_request' && !cancelled() }}
continue-on-error: true
uses: https://git.auengun.net/dosh-llc/action-pr-comment@86fe8f07115bd25af57b0ca15aec9b4dccdbcf8d # 0.0.3
- name: Create Release
if: ${{ success() && github.ref == 'refs/heads/main' }}
uses: https://git.auengun.net/actions/forgejo-release@fc0488c944626f9265d87fbc4dd6c08f78014c63 # v2.7.3
with:
direction: upload
url: https://git.auengun.net
release-dir: release
tag: "${{ env.RELEASE_TITLE }}"
title: "${{ env.RELEASE_TITLE }}"
token: "${{ secrets.REPO_PUBLISH_TOKEN }}"
release-notes: "${{ github.event.head_commit.message }}"
hide-archive-link: true
override: true