forked from cloned-doy/whatsfly
-
Notifications
You must be signed in to change notification settings - Fork 3
115 lines (99 loc) · 3.38 KB
/
build.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
schedule:
- cron: "1 1 * * *"
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
run: |
cd whatsfly/dependencies
go get -u
go mod tidy
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -v -buildmode=c-shared -ldflags=-s -o ./whatsmeow/static/whatsmeow-linux-amd64.so ./main.go
- name: Upload Linux binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-linux-amd64-v20.so
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-linux-amd64.so
- name: Upload Linux binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-linux-amd64-v20.h
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-linux-amd64.h
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
run: |
cd whatsfly/dependencies
go get -u
go mod tidy
go build -v -buildmode=c-shared -ldflags=-s -o ./whatsmeow/static/whatsmeow-windows-amd64.dll ./main.go
- name: Upload Windows binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-windows-amd64-v20.dll
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-windows-amd64.dll
- name: Upload Windows binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-windows-amd64-v20.h
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-windows-amd64.h
build-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
env:
CGO_ENABLED: 1
run: |
cd whatsfly/dependencies
go get -u
go mod tidy
GOOS=darwin GOARCH=amd64 go build -v -buildmode=c-shared -o ./whatsmeow/static/whatsmeow-darwin-amd64.dylib ./main.go
GOOS=darwin GOARCH=arm64 go build -v -buildmode=c-shared -o ./whatsmeow/static/whatsmeow-darwin-arm64.dylib ./main.go
- name: Upload macos binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-darwin-amd64-v20.dylib
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-darwin-amd64.dylib
- name: Upload macos binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-darwin-amd64-v20.h
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-darwin-amd64.h
- name: Upload macos binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-darwin-arm64-v20.dylib
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-darwin-arm64.dylib
- name: Upload macos binaries
uses: actions/upload-artifact@v4
with:
name: whatsmeow-darwin-arm64-v20.h
path: whatsfly/dependencies/whatsmeow/static/whatsmeow-darwin-arm64.h