Skip to content

Commit

Permalink
fixed multi OS builds, optimised Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrmqlly committed Oct 20, 2024
1 parent 0963450 commit ff94989
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/wails-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,36 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up Go environment (required for Wails backend)
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Install required packages for Wails
- name: Install Wails dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libwebkit2gtk-4.0-dev
# Install Wails CLI
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest


# Install Go dependencies (optional if using Go modules)
- name: Install Go dependencies
run: go mod tidy

# Build the Wails project (Wails handles frontend+backend)
- name: Build Wails App
run: wails build
12 changes: 12 additions & 0 deletions backend/utils/run_cmd_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build !windows
// +build !windows

package utils

import (
"os/exec"
)

func RunCmd(cmd *exec.Cmd) ([]byte, error) {
return cmd.CombinedOutput()
}
3 changes: 3 additions & 0 deletions backend/utils/run_cmd.go → backend/utils/run_cmd_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build windows
// +build windows

package utils

import (
Expand Down

0 comments on commit ff94989

Please sign in to comment.