Skip to content

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: |
VERSION=$(git describe --tags | tr -d 'v')
mkdir -p builds
# Create build directories for each platform
mkdir -p builds/linux_amd64
mkdir -p builds/windows_amd64
mkdir -p builds/darwin_amd64
# Copy config and templates to each platform directory
for platform in linux_amd64 windows_amd64 darwin_amd64; do
cp config.toml builds/${platform}/
cp -r templates builds/${platform}/
done
# Binary builds with platform-specific directories
GOOS=linux GOARCH=amd64 go build -o builds/linux_amd64/lilmail
GOOS=windows GOARCH=amd64 go build -o builds/windows_amd64/lilmail.exe
GOOS=darwin GOARCH=amd64 go build -o builds/darwin_amd64/lilmail
# Create archives for each platform
cd builds
zip -r lilmail${VERSION}_linux_amd64.zip linux_amd64/*
zip -r lilmail${VERSION}_windows_amd64.zip windows_amd64/*
zip -r lilmail${VERSION}_darwin_amd64.zip darwin_amd64/*
# Source archive including config and templates
cd ..
git archive --format=zip HEAD -o builds/lilmail${VERSION}_source.zip
# Clean up build directories
rm -rf builds/linux_amd64
rm -rf builds/windows_amd64
rm -rf builds/darwin_amd64
- uses: softprops/action-gh-release@v1
with:
files: builds/*