Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 71 additions & 17 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build and release (e.g., v1.0.0)'
required: true
type: string

jobs:
build-linux:
build-linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,49 +23,97 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libayatana-appindicator3-dev pkg-config
- name: Build Linux
- name: Build Linux AMD64
run: GOOS=linux GOARCH=amd64 go build -o freedom-core-linux-x64 ./cmd/server
- uses: actions/upload-artifact@v4
with:
name: freedom-core-linux-x64
path: freedom-core-linux-x64

build-windows:
build-macos-amd64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build macOS AMD64
run: |
go build -o freedom-core-macos-x64 ./cmd/server
- uses: actions/upload-artifact@v4
with:
name: freedom-core-macos-x64
path: freedom-core-macos-x64

build-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build macOS ARM64
run: |
go build -o freedom-core-macos-arm64 ./cmd/server
- uses: actions/upload-artifact@v4
with:
name: freedom-core-macos-arm64
path: freedom-core-macos-arm64

build-windows-amd64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build Windows
- name: Build Windows AMD64
shell: pwsh
run: |
$env:GOOS="windows"
$env:GOARCH="amd64"
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x64.exe ./cmd/server
- uses: actions/upload-artifact@v4
with:
name: freedom-core-windows-x64.exe
path: freedom-core-windows-x64.exe

build-windows-386:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build Windows 386
shell: pwsh
run: |
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x86.exe ./cmd/server
- uses: actions/upload-artifact@v4
with:
name: freedom-core-windows-x86.exe
path: freedom-core-windows-x86.exe

release:
needs: [build-linux, build-windows]
needs: [build-linux-amd64, build-macos-amd64, build-macos-arm64, build-windows-amd64, build-windows-386]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4
- name: Checkout code
uses: actions/checkout@v4
with:
name: freedom-core-linux-x64
path: artifacts
- uses: actions/download-artifact@v4
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: freedom-core-windows-x64.exe
path: artifacts
- name: Prepare release assets
run: |
mkdir release-assets
find artifacts -type f -exec cp {} release-assets/ \;
- name: Upload Executables to Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: artifacts/*
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
name: ${{ github.event.inputs.tag || github.ref_name }}
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@

---

### 1. Clone the Repository

```bash
git clone https://github.com/Freedom-Guard/freedom-core.git
cd freedom-core
````

---

### 2. Run Locally (Native)

```bash
Expand All @@ -48,11 +39,20 @@ go run cmd/server/main.go
Or build an executable:

```bash
# Windows
# Windows 64-bit
go build -o freedom-core.exe ./cmd/server

# Linux / macOS
# Windows 32-bit
GOOS=windows GOARCH=386 go build -o freedom-core-x86.exe ./cmd/server

# Linux 64-bit
go build -o freedom-core ./cmd/server

# macOS Intel (x64)
GOOS=darwin GOARCH=amd64 go build -o freedom-core-macos-x64 ./cmd/server

# macOS Apple Silicon (ARM64)
GOOS=darwin GOARCH=arm64 go build -o freedom-core-macos-arm64 ./cmd/server
```

* The service will start and show:
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ func main() {
logger.Log(logger.INFO, "Freedom-Core is starting... 🚀")
go app.RunTray()
core.StartCore()
}
}
5 changes: 4 additions & 1 deletion internal/app/tray.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build (windows && amd64) || (linux && amd64) || (darwin && (amd64 || arm64))

package app

import (
Expand All @@ -14,6 +16,7 @@ import (
//go:embed icon.ico
var iconData []byte

// RunTray starts the system tray
func RunTray() {
systray.Run(onReady, onExit)
}
Expand Down Expand Up @@ -50,4 +53,4 @@ func openLogsWindow() {

func onExit() {
logger.Log(logger.INFO, "Freedom Core exited")
}
}
6 changes: 6 additions & 0 deletions script/build-linux-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Building Freedom-Core for Linux 64-bit (x64)..."
export GOOS=linux
export GOARCH=amd64
go build -o freedom-core-linux-x64 ../cmd/server
echo "Build complete! Output: freedom-core-linux-x64"
6 changes: 6 additions & 0 deletions script/build-macos-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Building Freedom-Core for macOS Intel (x64)..."
export GOOS=darwin
export GOARCH=amd64
go build -o freedom-core-macos-x64 ../cmd/server
echo "Build complete! Output: freedom-core-macos-x64"
6 changes: 6 additions & 0 deletions script/build-macos-arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Building Freedom-Core for macOS Apple Silicon (ARM64)..."
export GOOS=darwin
export GOARCH=arm64
go build -o freedom-core-macos-arm64 ../cmd/server
echo "Build complete! Output: freedom-core-macos-arm64"
7 changes: 7 additions & 0 deletions script/build-windows-386.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
echo Building Freedom-Core for Windows 32-bit (x86)...
set GOOS=windows
set GOARCH=386
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x86.exe ../cmd/server
echo Build complete! Output: freedom-core-windows-x86.exe
pause
6 changes: 6 additions & 0 deletions script/build-windows-386.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Building Freedom-Core for Windows 32-bit (x86)..."
export GOOS=windows
export GOARCH=386
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x86.exe ../cmd/server
echo "Build complete! Output: freedom-core-windows-x86.exe"
7 changes: 7 additions & 0 deletions script/build-windows-amd64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
echo Building Freedom-Core for Windows 64-bit (x64)...
set GOOS=windows
set GOARCH=amd64
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x64.exe ../cmd/server
echo Build complete! Output: freedom-core-windows-x64.exe
pause
6 changes: 6 additions & 0 deletions script/build-windows-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Building Freedom-Core for Windows 64-bit (x64)..."
export GOOS=windows
export GOARCH=amd64
go build -ldflags "-H=windowsgui" -o freedom-core-windows-x64.exe ../cmd/server
echo "Build complete! Output: freedom-core-windows-x64.exe"