-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (30 loc) · 825 Bytes
/
build.yml
File metadata and controls
34 lines (30 loc) · 825 Bytes
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
name: Go Build
on:
push:
branches:
- master
env:
CI_BIN: wechat-mp-server
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: load Go 1.18 env
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: |
GOOS=linux GPARCH=amd64 go build -o ${{ env.CI_BIN }} -ldflags "-X 'wechat-mp-server/config.Version=$(git show -s --format=%h)'"
# 到这里编译就已经结束了 请自己根据自己的需要编辑ci文件