Merge pull request #104 from Labfox/dependabot/go_modules/whatsfly/de… #234
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |