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

Commit 439e823

Browse files
committed
Github actions stuff part 2
1 parent 4b8f0c5 commit 439e823

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

.github/workflows/build.yml

+32-20
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,67 @@ name: Go Build for Windows and Linux
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
pull_request:
88

99
jobs:
1010
build-windows:
11-
runs-on: windows-latest
11+
runs-on: windows-latest
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v3
1515

1616
- name: Set up Go
1717
uses: actions/setup-go@v4
1818
with:
19-
go-version: '1.21'
19+
go-version: '1.21'
2020

2121
- name: Build Go shared library (.dll)
2222
run: |
23-
cd go_spammer
24-
go build -o ../shared/spammer.dll -buildmode=c-shared main.go
23+
cd go_spammer
24+
go build -o spammer.dll -buildmode=c-shared main.go
25+
mkdir -p ../shared
26+
mv spammer.dll ../shared/spammer.dll
2527
26-
- name: Upload DLL artifact
27-
uses: actions/upload-artifact@v3
28-
with:
29-
name: spammer-dll
30-
path: ./shared/spammer.dll
28+
- name: Commit and push changes
29+
run: |
30+
git config --global user.email "[email protected]"
31+
git config --global user.name "GitHub Actions"
32+
git add ../shared/spammer.dll
33+
git commit -m "Add built spammer.dll for Windows"
34+
git push
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3137

3238
build-linux:
33-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-latest
3440
steps:
3541
- name: Checkout code
3642
uses: actions/checkout@v3
3743

3844
- name: Set up Go
3945
uses: actions/setup-go@v4
4046
with:
41-
go-version: '1.21'
47+
go-version: '1.21'
4248

4349
- name: Install GCC
4450
run: |
4551
sudo apt-get update
46-
sudo apt-get install -y build-essential # نصب GCC و ابزارهای ضروری برای بیلد
52+
sudo apt-get install -y build-essential
4753
4854
- name: Build Go shared library (.so)
4955
run: |
50-
cd go_spammer # به پوشه‌ی go_spammer بروید
51-
go build -o ../shared/spammer.so -buildmode=c-shared main.go # بیلد کتابخانه به‌صورت shared برای لینوکس
56+
cd go_spammer
57+
go build -o spammer.so -buildmode=c-shared main.go
58+
mkdir -p ../shared
59+
mv spammer.so ../shared/spammer.so
5260
53-
- name: Upload SO artifact
54-
uses: actions/upload-artifact@v3
55-
with:
56-
name: spammer-so
57-
path: ./shared/spammer.so
61+
- name: Commit and push changes
62+
run: |
63+
git config --global user.email "[email protected]"
64+
git config --global user.name "GitHub Actions"
65+
git add ../shared/spammer.so
66+
git commit -m "Add built spammer.so for Linux"
67+
git push
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)