.github/workflows/release.yml #10
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
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 lilmail directory for each platform | |
mkdir -p builds/lilmail | |
# Copy config and templates to the common lilmail directory | |
cp config.toml builds/lilmail/ | |
cp -r templates builds/lilmail/ | |
# Linux build | |
GOOS=linux GOARCH=amd64 go build -o builds/lilmail/lilmail | |
cd builds | |
zip -r lilmail${VERSION}_linux_amd64.zip lilmail/* | |
cd .. | |
rm builds/lilmail/lilmail | |
# Windows build | |
GOOS=windows GOARCH=amd64 go build -o builds/lilmail/lilmail.exe | |
cd builds | |
zip -r lilmail${VERSION}_windows_amd64.zip lilmail/* | |
cd .. | |
rm builds/lilmail/lilmail.exe | |
# Darwin build | |
GOOS=darwin GOARCH=amd64 go build -o builds/lilmail/lilmail | |
cd builds | |
zip -r lilmail${VERSION}_darwin_amd64.zip lilmail/* | |
cd .. | |
rm builds/lilmail/lilmail | |
# Source archive | |
git archive --format=zip HEAD -o builds/lilmail${VERSION}_source.zip | |
# Clean up build directory | |
rm -rf builds/lilmail | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: builds/* |