Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 4b8f0c5

Browse files
committed
Tried to add automatic building with github actions
1 parent 552192a commit 4b8f0c5

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/build.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Go Build for Windows and Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-windows:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.21'
20+
21+
- name: Build Go shared library (.dll)
22+
run: |
23+
cd go_spammer
24+
go build -o ../shared/spammer.dll -buildmode=c-shared main.go
25+
26+
- name: Upload DLL artifact
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: spammer-dll
30+
path: ./shared/spammer.dll
31+
32+
build-linux:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Go
39+
uses: actions/setup-go@v4
40+
with:
41+
go-version: '1.21'
42+
43+
- name: Install GCC
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y build-essential # نصب GCC و ابزارهای ضروری برای بیلد
47+
48+
- name: Build Go shared library (.so)
49+
run: |
50+
cd go_spammer # به پوشه‌ی go_spammer بروید
51+
go build -o ../shared/spammer.so -buildmode=c-shared main.go # بیلد کتابخانه به‌صورت shared برای لینوکس
52+
53+
- name: Upload SO artifact
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: spammer-so
57+
path: ./shared/spammer.so

shared/spammer.so

-6.94 MB
Binary file not shown.

0 commit comments

Comments
 (0)