Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.3.8 #82

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/docker_build_pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3


- uses: actions/setup-node@v4

- name: Build FE
run: make build_fe

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
Expand All @@ -47,6 +52,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./DockerfileGithubAction
platforms: |
linux/386
linux/amd64
Expand Down
26 changes: 26 additions & 0 deletions DockerfileGithubAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:alpine as serverbuild

WORKDIR /work

COPY server .

RUN apk update && apk add git
RUN go build -ldflags "-X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go


FROM alpine

WORKDIR /work

# 设置时区
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&&rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache


COPY --from=serverbuild /work/pmail .


CMD /work/pmail
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build: build_fe build_server package

clean:
rm -rf output

build_fe:
cd fe && yarn && yarn build
cd server && cp -rf ../fe/dist http_server

build_server:
cd server && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_linux_amd64 main.go
cd server && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_windows_amd64.exe main.go
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_amd64 main.go
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_arm64 main.go

package: clean
mkdir output
mv server/pmail* output/
mkdir config
cp -r server/config/dkim output/config/
cp -r server/config/ssl output/config/
cp -r server/config/config.json output/config/
cp README.md output/
26 changes: 0 additions & 26 deletions build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Config struct {
//go:embed tables/*
var tableConfig embed.FS

const Version = "2.3.7"
const Version = "2.3.8"

const DBTypeMySQL = "mysql"
const DBTypeSQLite = "sqlite"
Expand Down