From 83ba751410f80896e8eebb38994172e5109925bb Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Fri, 7 Feb 2025 20:30:41 +0000 Subject: [PATCH] integrating actual-server git workflows --- .github/workflows/build.yml | 14 +++++++++ .../workflows/docker-edge.yml | 4 +-- .../workflows/docker-release.yml | 4 +-- package.json | 2 +- packages/loot-core/package.json | 1 + .../sync-server/.github/workflows/build.yml | 29 ------------------- .../sync-server/.github/workflows/lint.yml | 29 ------------------- .../.github/workflows/release-notes.yml | 18 ------------ .../sync-server/.github/workflows/stale.yml | 26 ----------------- .../sync-server/.github/workflows/test.yml | 29 ------------------- packages/sync-server/src/load-config.js | 2 -- packages/sync-server/tsconfig.json | 3 +- yarn.lock | 3 +- 13 files changed, 23 insertions(+), 141 deletions(-) rename {packages/sync-server/.github => .github}/workflows/docker-edge.yml (93%) rename {packages/sync-server/.github => .github}/workflows/docker-release.yml (94%) delete mode 100644 packages/sync-server/.github/workflows/build.yml delete mode 100644 packages/sync-server/.github/workflows/lint.yml delete mode 100644 packages/sync-server/.github/workflows/release-notes.yml delete mode 100644 packages/sync-server/.github/workflows/stale.yml delete mode 100644 packages/sync-server/.github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea0ba68a4e..5e52bc9748 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,3 +68,17 @@ jobs: with: name: build-stats path: packages/desktop-client/build-stats + + server: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up environment + uses: ./.github/actions/setup + - name: Build Server + run: cd packages/sync-server && yarn build + - name: Upload Build + uses: actions/upload-artifact@v4 + with: + name: sync-server + path: packages/sync-server/build diff --git a/packages/sync-server/.github/workflows/docker-edge.yml b/.github/workflows/docker-edge.yml similarity index 93% rename from packages/sync-server/.github/workflows/docker-edge.yml rename to .github/workflows/docker-edge.yml index 497da722a8..11f141879e 100644 --- a/packages/sync-server/.github/workflows/docker-edge.yml +++ b/.github/workflows/docker-edge.yml @@ -71,7 +71,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Download artifacts - run: ./docker/download-artifacts.sh + run: ./packages/sync-server/docker/download-artifacts.sh env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -80,7 +80,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - file: docker/edge-${{ matrix.os }}.Dockerfile + file: packages/sync-server/docker/edge-${{ matrix.os }}.Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7${{ matrix.os == 'alpine' && ',linux/arm/v6' || '' }} tags: ${{ steps.meta.outputs.tags }} build-args: | diff --git a/packages/sync-server/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml similarity index 94% rename from packages/sync-server/.github/workflows/docker-release.yml rename to .github/workflows/docker-release.yml index eb43f0159a..f2bfbfdb04 100644 --- a/packages/sync-server/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -74,7 +74,7 @@ jobs: with: context: . push: true - file: docker/stable-ubuntu.Dockerfile + file: packages/sync-server/docker/stable-ubuntu.Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: ${{ steps.meta.outputs.tags }} @@ -83,6 +83,6 @@ jobs: with: context: . push: true - file: docker/stable-alpine.Dockerfile + file: packages/sync-server/docker/stable-alpine.Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.alpine-meta.outputs.tags }} diff --git a/package.json b/package.json index 3469873f1f..0fd9c5b07d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "start": "yarn start:browser", - "start:server": "yarn workspace actual-sync start", + "start:server": "yarn rebuild-node && yarn workspace actual-sync start", "start:desktop": "yarn rebuild-electron && npm-run-all --parallel 'start:desktop-*'", "start:desktop-node": "yarn workspace loot-core watch:node", "start:desktop-client": "yarn workspace @actual-app/web watch", diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json index 829342e2f8..bd09d1c25d 100644 --- a/packages/loot-core/package.json +++ b/packages/loot-core/package.json @@ -41,6 +41,7 @@ "devDependencies": { "@actual-app/api": "workspace:^", "@actual-app/crdt": "workspace:^", + "@actual-app/web": "workspace:^", "@swc/core": "^1.5.3", "@swc/helpers": "^0.5.11", "@swc/jest": "^0.2.36", diff --git a/packages/sync-server/.github/workflows/build.yml b/packages/sync-server/.github/workflows/build.yml deleted file mode 100644 index 996c0d3233..0000000000 --- a/packages/sync-server/.github/workflows/build.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build - -on: - push: - branches: - - master - pull_request: - branches: '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Cache - uses: actions/cache@v4 - id: cache - with: - path: '**/node_modules' - key: yarn-v1-${{ hashFiles('**/yarn.lock') }} - - name: Install - run: yarn --immutable - if: steps.cache.outputs.cache-hit != 'true' - - name: Build - run: yarn build diff --git a/packages/sync-server/.github/workflows/lint.yml b/packages/sync-server/.github/workflows/lint.yml deleted file mode 100644 index 73b25b6052..0000000000 --- a/packages/sync-server/.github/workflows/lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Linter - -on: - push: - branches: - - master - pull_request: - branches: '*' - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Cache - uses: actions/cache@v4 - id: cache - with: - path: '**/node_modules' - key: yarn-v1-${{ hashFiles('**/yarn.lock') }} - - name: Install - run: yarn --immutable - if: steps.cache.outputs.cache-hit != 'true' - - name: Lint - run: yarn lint diff --git a/packages/sync-server/.github/workflows/release-notes.yml b/packages/sync-server/.github/workflows/release-notes.yml deleted file mode 100644 index 9b4d75373b..0000000000 --- a/packages/sync-server/.github/workflows/release-notes.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Release notes - -on: - pull_request: - branches: '*' - -jobs: - release-notes: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Check release notes - if: startsWith(github.head_ref, 'release/') == false - uses: actualbudget/actions/release-notes/check@main - - name: Generate release notes - if: startsWith(github.head_ref, 'release/') == true - uses: actualbudget/actions/release-notes/generate@main diff --git a/packages/sync-server/.github/workflows/stale.yml b/packages/sync-server/.github/workflows/stale.yml deleted file mode 100644 index bdf6a25d12..0000000000 --- a/packages/sync-server/.github/workflows/stale.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 'Close stale PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity.' - days-before-stale: 30 - days-before-close: 5 - days-before-issue-stale: -1 - stale-wip: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-pr-message: ':wave: Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review.' - days-before-stale: 7 - any-of-labels: ':construction: WIP' - days-before-close: -1 - days-before-issue-stale: -1 diff --git a/packages/sync-server/.github/workflows/test.yml b/packages/sync-server/.github/workflows/test.yml deleted file mode 100644 index b1aca9e05c..0000000000 --- a/packages/sync-server/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test - -on: - push: - branches: - - master - pull_request: - branches: '*' - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Cache - uses: actions/cache@v4 - id: cache - with: - path: '**/node_modules' - key: yarn-v1-${{ hashFiles('**/yarn.lock') }} - - name: Install - run: yarn --immutable - if: steps.cache.outputs.cache-hit != 'true' - - name: Test - run: yarn test diff --git a/packages/sync-server/src/load-config.js b/packages/sync-server/src/load-config.js index 59482a6b00..f87e2b6cc5 100644 --- a/packages/sync-server/src/load-config.js +++ b/packages/sync-server/src/load-config.js @@ -70,8 +70,6 @@ let defaultConfig = { hostname: '::', webRoot: path.join( projectRoot, - '../', - '../', 'node_modules', '@actual-app', 'web', diff --git a/packages/sync-server/tsconfig.json b/packages/sync-server/tsconfig.json index cb09bd65f4..07b7b720f1 100644 --- a/packages/sync-server/tsconfig.json +++ b/packages/sync-server/tsconfig.json @@ -12,11 +12,10 @@ "jsx": "preserve", // Check JS files too "allowJs": true, - "checkJs": true, "moduleResolution": "node16", "module": "node16", "outDir": "build" }, "include": ["src/**/*.js", "types/global.d.ts"], - "exclude": ["node_modules", "build", "./app-plaid.js", "coverage"], + "exclude": ["node_modules", "build", "./app-plaid.js", "coverage"] } diff --git a/yarn.lock b/yarn.lock index 7c716eaee8..d83a2ab115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,7 +73,7 @@ __metadata: languageName: node linkType: hard -"@actual-app/web@workspace:packages/desktop-client": +"@actual-app/web@workspace:^, @actual-app/web@workspace:packages/desktop-client": version: 0.0.0-use.local resolution: "@actual-app/web@workspace:packages/desktop-client" dependencies: @@ -15976,6 +15976,7 @@ __metadata: dependencies: "@actual-app/api": "workspace:^" "@actual-app/crdt": "workspace:^" + "@actual-app/web": "workspace:^" "@jlongster/sql.js": "npm:^1.6.7" "@reduxjs/toolkit": "npm:^2.5.0" "@rschedule/core": "npm:^1.5.0"