-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.drone.yml
67 lines (61 loc) · 1.85 KB
/
.drone.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
61
62
63
64
65
66
67
kind: pipeline
name: Memos Build
node:
region: cn
trigger:
branch:
include:
- main
platform:
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: windows
arch: amd64
- os: darwin
arch: amd64
steps:
- name: Checkout repository
pull: if-not-exists
image: alpine/git
settings:
depth: 1
commands:
- export http_proxy=http://172.17.0.1:54321
- export https_proxy=http://172.17.0.1:54321
- git clone https://github.com/usememos/memos.git
- name: Setup Node.js
pull: if-not-exists
image: node:18.12.1
commands:
- export http_proxy=http://172.17.0.1:54321
- export https_proxy=http://172.17.0.1:54321
- cd memos/web
- npm install -g pnpm
- pnpm i --frozen-lockfile
- pnpm build
- ls -alh
- ls ../
- cp -rf dist ../server/
- name: Setup Go
pull: if-not-exists
image: ccr.ccs.tencentyun.com/xiaoqidun/goenv
environment:
DRONE_ARCH: "{{ arch }}"
DRONE_SYSTEM_EXT: ""
commands:
- cd memos
- CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -o release/memos_window_amd64.exe -trimpath -ldflags '-H windowsgui -s -w' main.go
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o release/memos_linux_amd64 -trimpath -ldflags '-s -w' main.go
- GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o release/memos_linux_arm64 -trimpath -ldflags '-s -w' main.go
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o release/memos_darwin_amd64 -trimpath -ldflags '-s -w' main.go
- ls -alh
# - name: Upload artifacts
# image: plugins/s3
# settings:
# bucket: my-bucket-name
# source: memos/memos-${DRONE_ARCH}${DRONE_SYSTEM_EXT}
# target: latest/memos-${DRONE_ARCH}${DRONE_SYSTEM_EXT}