Skip to content

Github Actions stuff part 4 #3

Github Actions stuff part 4

Github Actions stuff part 4 #3

Workflow file for this run

name: Go Build for Windows and Linux
on:
push:
branches:
- main
pull_request:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build Go shared library (.dll)
run: |
cd go_spammer
go build -o ../shared/spammer.dll -buildmode=c-shared main.go
- name: Commit and push changes
run: |
git config --global user.email "your-email@example.com"
git config --global user.name "GitHub Actions"
git add ../shared/spammer.dll
git commit -m "Add built spammer.dll for Windows"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install GCC
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build Go shared library (.so)
run: |
cd go_spammer
go build -o ../shared/spammer.so -buildmode=c-shared main.go
- name: Commit and push changes
run: |
git config --global user.email "your-email@example.com"
git config --global user.name "GitHub Actions"
git add ../shared/spammer.so
git commit -m "Add built spammer.so for Linux"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}