Skip to content

Commit

Permalink
SkyeCraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Skye committed Sep 27, 2024
0 parents commit aa5667e
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Go Cross-Platform Build

on:
push:
branches:
- main
pull_request:

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.20']

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

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Install dependencies
run: go mod download

- name: Build for ${{ matrix.os }}
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
GOOS=linux GOARCH=amd64 go build -o builds/SkyeCraft-linux
elif [[ "$RUNNER_OS" == "macOS" ]]; then
go build -o builds/SkyeCraft-macOS
elif [[ "$RUNNER_OS" == "Windows" ]]; then
GOOS=windows GOARCH=amd64 go build -ldflags="-H windowsgui" -o builds/SkyeCraft.exe
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: SkyeCraft
path: builds/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build.sh
Binary file added builds/SkyeCraft-macOS
Binary file not shown.
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module example.com/app

go 1.23.0

require github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6 h1:VQpB2SpK88C6B5lPHTuSZKb2Qee1QWwiFlC5CKY4AW0=
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6/go.mod h1:yE65LFCeWf4kyWD5re+h4XNvOHJEXOCOuJZ4v8l5sgk=
33 changes: 33 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"os"
"path/filepath"

webview "github.com/webview/webview_go"
)

func main() {
// Create a new webview instance
w := webview.New(true) // `true` enables debug mode
defer w.Destroy()

// Set window title and dimensions
w.SetTitle("SkyeCraft")
w.SetSize(800, 600, webview.HintNone)

// Get the current working directory
dir, err := os.Getwd()
if err != nil {
panic(err)
}

// Build the full path to the HTML file
htmlPath := filepath.Join(dir, "skyecraft.html")

// Load the local HTML file
w.Navigate("file://" + htmlPath)

// Run the webview instance
w.Run()
}
265 changes: 265 additions & 0 deletions skyecraft.html

Large diffs are not rendered by default.

0 comments on commit aa5667e

Please sign in to comment.