mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
refactor(repo): consolidate openflare-server to root and move subprojects to internal/apps
- Merge all files inside openflare-server to the repository root directory. - Relocate agent, relay, and flared subprojects from internal/ to internal/apps/. - Combine docker-compose files and update build context paths to root. - Update GitHub workflows and Dockerfiles to refer to new directories and package names. - Rewrite Go package imports across all files. - Resolve database renew test race condition and clean up docs.
This commit is contained in:
@@ -74,7 +74,7 @@ jobs:
|
||||
id: build
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: ./openflare-server
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
env:
|
||||
CI: ""
|
||||
run: |
|
||||
cd openflare-server/frontend
|
||||
cd frontend
|
||||
corepack enable
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build:embed
|
||||
@@ -27,4 +27,4 @@ jobs:
|
||||
with:
|
||||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
BRANCH: gh-pages # The branch the action should deploy to.
|
||||
FOLDER: openflare-server/frontend/out # The folder the action should deploy.
|
||||
FOLDER: frontend/out # The folder the action should deploy.
|
||||
@@ -80,10 +80,10 @@ jobs:
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
cache-dependency-path: openflare-server/frontend/pnpm-lock.yaml
|
||||
cache-dependency-path: frontend/pnpm-lock.yaml
|
||||
|
||||
- name: Build Frontend
|
||||
working-directory: openflare-server/frontend
|
||||
working-directory: frontend
|
||||
env:
|
||||
CI: ""
|
||||
NEXT_PUBLIC_APP_VERSION: ${{ needs.prepare.outputs.version }}
|
||||
@@ -93,14 +93,14 @@ jobs:
|
||||
|
||||
- name: Prepare embed directory
|
||||
run: |
|
||||
rm -rf openflare-server/internal/router/root/dist
|
||||
cp -R openflare-server/frontend/out openflare-server/internal/router/root/dist
|
||||
rm -rf internal/router/root/dist
|
||||
cp -R frontend/out internal/router/root/dist
|
||||
|
||||
- name: Upload Frontend Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: frontend-build
|
||||
path: openflare-server/internal/router/root/dist
|
||||
path: internal/router/root/dist
|
||||
retention-days: 1
|
||||
|
||||
build-binaries:
|
||||
@@ -139,16 +139,15 @@ jobs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: frontend-build
|
||||
path: openflare-server/internal/router/root/dist
|
||||
path: internal/router/root/dist
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: openflare-server/go.mod
|
||||
cache-dependency-path: openflare-server/go.sum
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
||||
- name: Build Server
|
||||
working-directory: openflare-server
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -157,10 +156,10 @@ jobs:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
run: |
|
||||
go mod download
|
||||
mkdir -p ../dist
|
||||
mkdir -p dist
|
||||
go build -trimpath -tags embed_frontend \
|
||||
-ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/buildinfo.Version=$VERSION'" \
|
||||
-o "../dist/$ASSET_NAME" ./main.go
|
||||
-o "dist/$ASSET_NAME" ./main.go
|
||||
|
||||
- name: Upload Binary Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -202,7 +201,6 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Build Agent
|
||||
working-directory: openflare-agent
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -211,9 +209,9 @@ jobs:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
run: |
|
||||
go mod download
|
||||
mkdir -p ../dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflare-agent/internal/config.Version=$VERSION'" -o "../dist/$ASSET_NAME" ./cmd/agent
|
||||
(cd ../dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
mkdir -p dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/apps/agent/config.Version=$VERSION'" -o "dist/$ASSET_NAME" ./cmd/agent/main.go
|
||||
(cd dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
|
||||
- name: Upload Agent Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -257,7 +255,6 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Build Relay
|
||||
working-directory: openflare-relay
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -266,9 +263,9 @@ jobs:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
run: |
|
||||
go mod download
|
||||
mkdir -p ../dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflare-relay/internal/config.Version=$VERSION'" -o "../dist/$ASSET_NAME" ./cmd/relay
|
||||
(cd ../dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
mkdir -p dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/apps/relay/config.Version=$VERSION'" -o "dist/$ASSET_NAME" ./cmd/relay/main.go
|
||||
(cd dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
|
||||
- name: Upload Relay Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -312,7 +309,6 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Build Flared
|
||||
working-directory: openflared
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -321,9 +317,9 @@ jobs:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
run: |
|
||||
go mod download
|
||||
mkdir -p ../dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflared/internal/config.Version=$VERSION'" -o "../dist/$ASSET_NAME" ./cmd/flared
|
||||
(cd ../dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
mkdir -p dist
|
||||
go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/apps/flared/config.Version=$VERSION'" -o "dist/$ASSET_NAME" ./cmd/flared/main.go
|
||||
(cd dist && sha256sum "$ASSET_NAME" > "$ASSET_NAME.sha256")
|
||||
|
||||
- name: Upload Flared Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
Reference in New Issue
Block a user