-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.48 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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/*