GH Actions: use ncipollo/release-action #6
Workflow file for this run
This file contains 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 and Release Caddy with Security Plugin | |
on: | |
push: | |
tags: | |
- 'v*' # Trigger the workflow for any tag starting with "v" | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
name: Build and Release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] # Build for both amd64 and arm64 | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# Set up architecture-specific environment | |
- name: Set Architecture | |
run: echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV | |
# Install dependencies and build Caddy with the security plugin | |
- name: Run Build Script | |
run: | | |
chmod +x ./build.sh | |
export SKIP_GO_INSTALLER="no" | |
export SKIP_XCADDY_INSTALLER="no" | |
export GO_VERSION=1.23.3 | |
export CADDY_OUTPUT="./out/caddy-${{ github.ref_name }}-${{ matrix.arch }}" | |
./build.sh | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "out/caddy-${{ github.ref_name }}-linux-${{ matrix.arch }}" | |
allowUpdates: true |