diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 8657737..10aeda8 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -13,62 +13,46 @@ env: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux/amd64 + - os: ubuntu-latest + platform: linux/arm64 + - os: macos-latest + platform: darwin/universal + - os: windows-latest + platform: windows/amd64 + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 + - name: Build + uses: host-uk/build@dev with: - go-version-file: 'go.mod' - - - name: Install core CLI - run: | - curl -fsSL "https://github.com/host-uk/core/releases/download/${{ env.CORE_VERSION }}/core-linux-amd64" -o /tmp/core - chmod +x /tmp/core - sudo mv /tmp/core /usr/local/bin/core - core --version - - - name: Generate code - run: go generate ./internal/cmd/updater/... - - - name: Build all targets - run: core build --targets=linux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64,windows/arm64 --ci - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: binaries - path: dist/ + build-name: core + build-platform: ${{ matrix.platform }} + build: true + package: true + sign: false release: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Download artifacts uses: actions/download-artifact@v4 with: - name: binaries path: dist + merge-multiple: true - name: Prepare release files run: | mkdir -p release - cp dist/*.tar.gz dist/*.zip dist/CHECKSUMS.txt release/ 2>/dev/null || true - # Also copy raw binaries for direct download - for dir in dist/*/; do - if [ -d "$dir" ]; then - platform=$(basename "$dir") - for bin in "$dir"*; do - if [ -f "$bin" ]; then - name=$(basename "$bin") - cp "$bin" "release/core-${platform//_/-}${name##core}" - fi - done - fi - done + cp dist/* release/ 2>/dev/null || true ls -la release/ - name: Delete existing dev release @@ -96,9 +80,6 @@ jobs: # macOS/Linux curl -fsSL https://github.com/host-uk/core/releases/download/dev/core-linux-amd64 -o core chmod +x core && sudo mv core /usr/local/bin/ - - # Or with Homebrew - brew tap host-uk/tap && brew install host-uk/tap/core \`\`\` This is a pre-release for testing. Use tagged releases for production." \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61b5c53..b09ba4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,67 +8,48 @@ on: permissions: contents: write -env: - CORE_VERSION: dev - jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux/amd64 + - os: ubuntu-latest + platform: linux/arm64 + - os: macos-latest + platform: darwin/universal + - os: windows-latest + platform: windows/amd64 + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 + - name: Build + uses: host-uk/build@dev with: - go-version-file: 'go.mod' - - - name: Install core CLI - run: | - curl -fsSL "https://github.com/host-uk/core/releases/download/${{ env.CORE_VERSION }}/core-linux-amd64" -o /tmp/core - chmod +x /tmp/core - sudo mv /tmp/core /usr/local/bin/core - core --version - - - name: Generate code - run: go generate ./internal/cmd/updater/... - - - name: Build all targets - run: core build --targets=linux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64,windows/arm64 --ci - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: binaries - path: dist/ + build-name: core + build-platform: ${{ matrix.platform }} + build: true + package: true + sign: false release: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Download artifacts uses: actions/download-artifact@v4 with: - name: binaries path: dist + merge-multiple: true - name: Prepare release files run: | mkdir -p release - cp dist/*.tar.gz dist/*.zip dist/CHECKSUMS.txt release/ 2>/dev/null || true - # Also copy raw binaries for direct download - for dir in dist/*/; do - if [ -d "$dir" ]; then - platform=$(basename "$dir") - for bin in "$dir"*; do - if [ -f "$bin" ]; then - name=$(basename "$bin") - cp "$bin" "release/core-${platform//_/-}${name##core}" - fi - done - fi - done + cp dist/* release/ 2>/dev/null || true ls -la release/ - name: Create release diff --git a/README.md b/README.md index 0ea31d4..23d45c0 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ Core is a Web3 Framework, written in Go using Wails.io to replace Electron and the bloat of browsers that, at their core, still live in their mum's basement. -- Discord: http://discord.dappco.re -- Repo: https://github.com/Snider/Core +- Repo: https://github.com/host-uk/core ## Vision @@ -26,7 +25,7 @@ Core is an **opinionated Web3 desktop application framework** providing: ## Quick Start ```go -import core "github.com/Snider/Core" +import core "github.com/host-uk/core" app := core.New( core.WithServiceLock(), @@ -144,7 +143,7 @@ app.RegisterService(application.NewService(coreService)) // Only Core is regist **Currently exposed** (see `cmd/core-gui/public/bindings/`): ```typescript // From frontend: -import { ACTION, Config, Service } from './bindings/github.com/Snider/Core/pkg/core' +import { ACTION, Config, Service } from './bindings/github.com/host-uk/core/pkg/core' ACTION(msg) // Broadcast IPC message Config() // Get config service reference @@ -159,7 +158,7 @@ Sub-services are accessed via Core's **IPC/ACTION system**, not direct Wails bin ```typescript // Frontend calls Core.ACTION() with typed messages -import { ACTION } from './bindings/github.com/Snider/Core/pkg/core' +import { ACTION } from './bindings/github.com/host-uk/core/pkg/core' // Open a window ACTION({ action: "display.open_window", name: "settings", options: { Title: "Settings", Width: 800 } }) @@ -198,7 +197,7 @@ cd cmd/core-gui wails3 generate bindings # Regenerate after Go changes ``` -Bindings output to `cmd/core-gui/public/bindings/github.com/Snider/Core/` mirroring Go package structure. +Bindings output to `cmd/core-gui/public/bindings/github.com/host-uk/core/` mirroring Go package structure. --- diff --git a/pkg/io/local/client.go b/pkg/io/local/client.go index 189c122..8814592 100644 --- a/pkg/io/local/client.go +++ b/pkg/io/local/client.go @@ -32,16 +32,15 @@ func (m *Medium) path(p string) string { } clean := strings.ReplaceAll(p, "..", ".") if filepath.IsAbs(clean) { - // Handle Windows drive root (e.g. "C:\") - if len(clean) == 3 && clean[1] == ':' && (clean[2] == '\\' || clean[2] == '/') { - return clean - } // If root is "/", allow absolute paths through if m.root == "/" { return filepath.Clean(clean) } - // Otherwise, sandbox absolute paths by stripping leading / - return filepath.Join(m.root, strings.TrimPrefix(clean, "/")) + // Otherwise, sandbox absolute paths by stripping volume + leading separators + vol := filepath.VolumeName(clean) + clean = strings.TrimPrefix(clean, vol) + clean = strings.TrimLeft(clean, string(os.PathSeparator)+"/") + return filepath.Join(m.root, clean) } return filepath.Join(m.root, clean) }