Skip to content

Build workflow

Build workflow #9

Workflow file for this run

name: Release
on:
push:
tags:
- v*
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build caddy
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
go: [~1.22.1]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Build Caddy
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
wget https://github.com/caddyserver/xcaddy/releases/download/v0.3.5/xcaddy_0.3.5_linux_amd64.tar.gz
tar -xzvf xcaddy_0.3.5_linux_amd64.tar.gz
GOOS=$GOOS GOARCH=$GOARCH ./xcaddy build \
--with github.com/${{ github.repository }}@${{ github.ref_name}} \
--output "caddy-$GOOS-$GOARCH"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: caddy-${{ matrix.goos }}-${{ matrix.goarch }}
path: caddy-${{ matrix.goos }}-${{ matrix.goarch }}
release:
name: Create release notes
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
pattern: caddy-*
merge-multiple: true
- name: Create release notes
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
artifacts: "caddy-*"
prerelease: true