Go backend (#1555)
* Replaces old Deno server with a Go implementation * Restructured the code base accordingly
This commit is contained in:
+55
-34
@@ -1,38 +1,59 @@
|
||||
name: Build & Release Edge
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
- name: Compile for all platforms
|
||||
run: |
|
||||
deno task build
|
||||
deno task server:zip:linux-x86_64
|
||||
deno task server:zip:linux-aarch64
|
||||
deno task server:zip:darwin-x86_64
|
||||
deno task server:zip:darwin-aarch64
|
||||
deno task server:zip:windows-x86_64
|
||||
- name: Update edge release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: false
|
||||
tag_name: edge
|
||||
body: Automated build from commit ${{ github.sha }}
|
||||
prerelease: true
|
||||
files: |
|
||||
website/CHANGELOG.md
|
||||
dist/plug-compile.js
|
||||
dist/silverbullet.js
|
||||
silverbullet-*.zip
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.25.1"
|
||||
- name: Compile frontend and plug-compile with Deno
|
||||
run: |
|
||||
deno task build-production
|
||||
deno task build-plug-compile
|
||||
- name: Build Go binaries for multiple platforms
|
||||
run: |
|
||||
# Linux ARM64
|
||||
GOOS=linux GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-aarch64.zip silverbullet
|
||||
|
||||
# Linux x86_64
|
||||
GOOS=linux GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-x86_64.zip silverbullet
|
||||
|
||||
# macOS ARM64
|
||||
GOOS=darwin GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-aarch64.zip silverbullet
|
||||
|
||||
# macOS x86_64
|
||||
GOOS=darwin GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-x86_64.zip silverbullet
|
||||
|
||||
# Windows x86_64
|
||||
GOOS=windows GOARCH=amd64 go build -o silverbullet.exe .
|
||||
zip silverbullet-server-windows-x86_64.zip silverbullet.exe
|
||||
|
||||
- name: Update edge release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: false
|
||||
tag_name: edge
|
||||
body: Automated build from commit ${{ github.sha }}
|
||||
prerelease: true
|
||||
files: |
|
||||
website/CHANGELOG.md
|
||||
dist/plug-compile.js
|
||||
silverbullet-*.zip
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
name: Build & Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write # The OIDC ID token is used for authentication with JSR.
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
- name: Run build
|
||||
run: |
|
||||
deno task build
|
||||
- name: Publish to JSR
|
||||
run: deno publish --allow-dirty
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: false
|
||||
files: |
|
||||
website/CHANGELOG.md
|
||||
dist/plug-compile.js
|
||||
dist/silverbullet.js
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write # The OIDC ID token is used for authentication with JSR.
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
- name: Run build
|
||||
run: |
|
||||
deno task build-production
|
||||
deno task build-plug-compile
|
||||
- name: Publish to JSR
|
||||
run: deno publish --allow-dirty
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: false
|
||||
files: |
|
||||
website/CHANGELOG.md
|
||||
dist/plug-compile.js
|
||||
|
||||
@@ -1,43 +1,54 @@
|
||||
name: Server
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.25.1"
|
||||
- name: Compile client and plug-compile with Deno
|
||||
run: |
|
||||
deno task build-production
|
||||
deno task build-plug-compile
|
||||
- name: Build Go binaries for multiple platforms
|
||||
run: |
|
||||
# Linux ARM64
|
||||
GOOS=linux GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-aarch64.zip silverbullet
|
||||
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
# Linux x86_64
|
||||
GOOS=linux GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-x86_64.zip silverbullet
|
||||
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.5.0
|
||||
# macOS ARM64
|
||||
GOOS=darwin GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-aarch64.zip silverbullet
|
||||
|
||||
- name: Build bundles
|
||||
run: |
|
||||
deno task build
|
||||
# macOS x86_64
|
||||
GOOS=darwin GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-x86_64.zip silverbullet
|
||||
|
||||
- name: Compile for all platforms
|
||||
run: |
|
||||
deno task server:zip:linux-x86_64
|
||||
deno task server:zip:linux-aarch64
|
||||
deno task server:zip:darwin-x86_64
|
||||
deno task server:zip:darwin-aarch64
|
||||
deno task server:zip:windows-x86_64
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
silverbullet-*.zip
|
||||
# Windows x86_64
|
||||
GOOS=windows GOARCH=amd64 go build -o silverbullet.exe .
|
||||
zip silverbullet-server-windows-x86_64.zip silverbullet.exe
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
dist/plug-compile.js
|
||||
silverbullet-*.zip
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Test
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -10,7 +10,7 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
test-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -43,20 +43,11 @@ jobs:
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Verify Go installation
|
||||
run: go version
|
||||
- name: Run Go tests
|
||||
run: go test ./server/... -v
|
||||
|
||||
- name: Verify Go modules
|
||||
run: go mod verify
|
||||
- name: Run Go tests with coverage
|
||||
run: go test ./server/... -coverprofile=coverage.out
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
#- name: Run Go tests
|
||||
# run: go test ./server_go -v
|
||||
|
||||
#- name: Run Go tests with coverage
|
||||
# run: go test ./server_go -coverprofile=coverage.out
|
||||
|
||||
#- name: Display test coverage
|
||||
# run: go tool cover -func=coverage.out
|
||||
- name: Display test coverage
|
||||
run: go tool cover -func=coverage.out
|
||||
|
||||
Reference in New Issue
Block a user