文件历史

66 次代码提交

作者 SHA1 备注 提交日期
caorushizi 3f889da389 fix(ci): move secrets check off if: to dodge Unrecognized named-value: 'secrets'
The Docker Hub mirror workflow used `secrets.DOCKERHUB_USERNAME != ''`
directly inside step `if:` conditions and step-level `env:`
expressions. GitHub's expression parser now rejects that with
`Unrecognized named-value: 'secrets'` — the `secrets` context is only
allowed in a narrow set of positions (mostly `with:` inputs and step
`env:` values, not inside `if:` expressions).

Route the check through a dedicated detection step whose `env:` reads
the secrets (the one permitted way to surface them) and writes a
plain boolean to step outputs. Every downstream conditional then
guards on `steps.dockerhub.outputs.enabled == 'true'` instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 16:46:52 +08:00
caorushizi ab669f2e74 ci(docker): mirror image to Docker Hub alongside GHCR
Every image published to `ghcr.io/caorushizi/mediago` now also gets
pushed to `docker.io/caorushizi/mediago` under the same tags, so users
can `docker pull caorushizi/mediago:3.5.0` without setting up GHCR
auth.

- New `DOCKERHUB_IMAGE` env var pinning the Docker Hub slug.
- New `Login to Docker Hub` step guarded by
  `secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != ''`
  so forks without Docker Hub credentials can still build + push to
  GHCR without failing the login.
- New `Resolve image targets` step that composes the metadata-action
  `images:` list at runtime — only adds the Docker Hub target when
  both secrets are present. Without this, metadata-action would keep
  emitting Docker Hub tags that build-push-action would then 401 on.
- Build Summary shows both `docker pull` hints when Docker Hub is
  enabled.

Setup (one-time, in repo Settings → Secrets and variables → Actions):
- `DOCKERHUB_USERNAME`: Docker Hub account name
- `DOCKERHUB_TOKEN`:    PAT from https://hub.docker.com/settings/security
                        with Read+Write scope on caorushizi/mediago

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 16:10:33 +08:00
caorushizi d23f594b88 ci(docker): allow rebuilding an existing tag via workflow_dispatch
When a released image has to be re-cut (e.g. the broken 3.5.0 that
shipped with the stale per-downloader flags), there was no clean way
to re-publish under the same tag from the workflow — only a fresh
git tag push would trigger a build.

Extend `workflow_dispatch` with two inputs:

- `tag`        — image tag to publish under (e.g. `3.5.0` to overwrite
                 the existing one, or `3.5.0-fix.1` for a side-by-side).
                 Empty value falls back to the pre-existing
                 `dev-<run_id>` behaviour.
- `push_latest` — when rebuilding a stable release manually, optionally
                  re-stamp the `latest` tag at the same time.

`docker/metadata-action` already emits the standard OCI labels,
including `org.opencontainers.image.revision` sourced from `github.sha`.
That field alone is enough to tell two same-tag builds apart via
`docker inspect` — no Dockerfile changes needed, no manually-computed
build args. Summary step now reads version / commit from metadata-action's
own outputs (`steps.meta.outputs.version`) and `github.sha`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 14:36:30 +08:00
caorushizi 9428f52f7d chore(ci): upgrade Node.js from 20 to 24 LTS
Node.js 20 reached EOL in April 2026. Upgrade build Node.js
version to 24.14.0 LTS across all CI workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:12:47 +08:00
caorushizi 0be4e5b9e6 chore(ci): upgrade GitHub Actions to Node 24 compatible versions
Upgrade all actions to eliminate Node.js 20 deprecation warnings:
- actions/checkout v5 → v6
- actions/setup-node v4 → v6
- actions/setup-go v5 → v6
- actions/upload-artifact v4 → v6
- pnpm/action-setup v4 → v5
- docker/setup-buildx-action v3 → v4
- docker/login-action v3 → v4
- docker/metadata-action v5 → v6
- docker/build-push-action v6 → v7

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:09:47 +08:00
caorushizi 1dd39a6973 chore(docker): rewrite Dockerfile and CI for GHCR multi-arch builds
- Rewrite Dockerfile as 3-stage build (Node builder → Go builder → runtime)
- Use --platform=$BUILDPLATFORM for native Node/Go compilation (no QEMU)
- Cross-compile Go binary via GOOS/GOARCH for target architecture
- Add --platform flag to download-deps.ts for target-specific deps
- Map Docker TARGETARCH to Node arch naming (amd64 → linux-x64)
- Flatten deps directory structure in runtime image
- Rewrite build-server.yml to push to ghcr.io with docker/metadata-action
- Single job multi-arch build (linux/amd64 + linux/arm64) via QEMU
- Update .dockerignore to exclude electron, docs, build artifacts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 23:14:42 +08:00
caorushizi 452bbc3b7d refactor: merge player Go backend into core
Merge the standalone mediago-player binary into mediago-core. The core
now serves the player UI at /player/ via go:embed, and provides video
listing/streaming endpoints. Video root reuses the existing download
directory (local-dir) so no separate flag is needed.

Changes:
- Add internal/video package to core (handler, service, types)
- Embed player-ui assets via //go:embed in assets/embed.go
- Add SPA handler for /player/ path
- Register /api/v1/videos and /videos/* routes in core router
- core:build now builds player-ui before Go compilation
- Remove apps/player/ entirely (Go app, scripts, configs)
- Remove VideoServer from Electron, derive playerUrl from coreUrl
- Remove player binary management from server app
- Update CI workflow to remove player go.sum cache path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:05:42 +08:00
caorushizi 38a4f63269 fix(ci,player): fix Windows build and add deps download step
- Add shell option for Windows in player's runCommand to fix
  "spawn pnpm ENOENT" error (Windows needs shell:true to find .cmd)
- Add deps:download step to CI workflow so third-party tools
  (ffmpeg, BBDown, etc.) are available during packaging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:52:09 +08:00
caorushizi a6eae611af fix(ci): add Go and swag setup to electron build workflow
The build was failing because:
- macOS runners don't have Go pre-installed (exit code 127)
- Ubuntu/Windows runners lack the swag tool (spawn swag ENOENT)

Add setup-go action and swag installation step before building.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:42:50 +08:00
caorushizi 38cb884b77 style: apply oxfmt formatting across codebase
Also fix pre-existing lint errors exposed by staging:
- Merge duplicate 'eventsource' imports in eventEmitter.ts
- Remove unused catch parameter in eventEmitter.ts
- Merge duplicate 'react' imports in app-side-bar.tsx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:12:49 +08:00
caorushizi 3d4ae46e30 fix: 构建 dev 版本的 docker 2025-11-18 13:06:17 +08:00
caorushizi 4a560a0f63 fix: docker image id
Make MediaGo Docker Image / Build Docker Image (arm64, linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Make MediaGo Docker Image / Create Multi-Arch Manifest (push) Has been cancelled
Make MediaGo Docker Image / Build Docker Image (amd64, linux/amd64, ubuntu-latest) (push) Failing after 1s
2025-11-05 00:50:58 +08:00
caorushizi a52518be28 fix: docker build 2025-11-03 15:21:32 +08:00
caorushizi 18cb7709de fix: docker build 2025-11-03 11:50:09 +08:00
caorushizi c1bda7fa9c fix: electron build 2025-11-03 11:41:12 +08:00
caorushizi b55dd91320 fix: pnpm setup 2025-11-03 11:35:28 +08:00
caorushizi 9c2f4664d6 fix: electron build 2025-11-03 11:26:05 +08:00
caorushizi 2467088b2f fix: electron builder 2025-11-03 11:10:34 +08:00
caorushizi 16809c4ab5 fix: server build 2025-11-01 16:30:51 +08:00
caorushizi 5dad2fb876 fix: build cache 2025-10-08 22:24:17 +08:00
caorushizi 3c78f377fc fix: build failed 2025-10-08 21:42:54 +08:00
caorushizi b869f23b20 fix: build failed 2025-10-08 21:00:03 +08:00
caorushizi 144ba39fdc fix: build failed 2025-10-08 20:47:00 +08:00
caorushizi ebb544cbcb fix: build failed 2025-10-08 20:27:51 +08:00
caorushizi ecc45895d0 fix: build failed 2025-10-08 17:57:56 +08:00
caorushizi 252a166978 feat: edit action script 2025-10-08 17:47:39 +08:00
caorushizi 49195f4206 feat: edit action script 2025-10-08 17:38:20 +08:00
caorushizi 0659964009 feat: edit action script 2025-10-08 17:35:29 +08:00
caorushizi 103a111191 feat: edit action script 2025-10-08 17:30:45 +08:00
caorushizi 1a45c685e7 feat: edit action script 2025-10-08 17:12:02 +08:00
caorushizi d6ae275bf3 feat: edit actions sctipts 2025-10-08 16:58:05 +08:00
caorushizi 90218e876e docs: add docs 2025-09-05 19:55:46 +08:00
caorushizi e5fad91210 feat: 🐳 add Docker development environment for webapi
- Add Docker configuration to resolve node-pty native module conflicts
- Create docker/Dockerfile for production builds
- Create docker/Dockerfile.dev for development with hot reload
- Add docker-compose.yml for easy development setup
- Include system dependencies (python3, make, g++, libicu-dev) for native modules
- Update package.json with dev:docker and build:docker commands
- Move .dockerignore to root directory for proper build context
- Remove electron rebuild scripts as Docker handles native module compilation
- Enable mixed development: webapi in container, electron on host

Usage:
- pnpm dev:docker # Start webapi in Docker container
- pnpm -F electron dev # Start electron locally in parallel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-05 19:55:46 +08:00
caorushizi 763a5fcd86 refactor: 📦️ rename apps and migrate to pure Turborepo build system
- Rename apps with more descriptive names:
  • main → electron (Electron main process)
  • renderer → frontend (React UI for both Electron and web)
  • backend → webapi (Koa.js API server)

- Remove tools/scripts custom build logic:
  • Replace custom zx scripts with native Turbo commands
  • Update dev command to use Turbo filters for plugin/mobile builds
  • Migrate web-release build to use Turbo pipeline
  • Remove tools/scripts directory entirely

- Update comprehensive README documentation for each app:
  • apps/electron/README.md - Desktop application lifecycle and system integration
  • apps/frontend/README.md - React UI shared between Electron and web
  • apps/webapi/README.md - Standalone API server with Docker support

- Update all configuration references:
  • package.json: Update all Turbo filter commands
  • biome.json: Remove tools/scripts path references
  • pnpm-workspace.yaml: Remove tools/* workspace
  • CLAUDE.md: Update architecture documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-05 19:55:46 +08:00
caorushizi 9d30a04cdf ci: 🎡 disable automatic triggering 2025-02-10 17:53:59 +08:00
曹儒士子 7c756cccef feat: docker platform (#371)
* feat:   docker platform

* feat:   docker arch
2024-12-15 10:56:35 +08:00
caorushizi 40cdecc820 docs: 📝 remove docs 2024-12-09 12:55:18 +08:00
士子☀️ c9ae9e6b32 Fix mac build (#319)
* fix: 🐛  Mac build
#230 修复 intel 无法打开的问题
2024-10-07 14:53:08 +08:00
caorushizi 43ed1f8e3f fix: 🐛 mac build 2024-10-07 00:52:52 +08:00
caorushizi c1502c0230 fix: 🐛 便携版上传 2024-09-25 03:04:59 +08:00
caorushizi 9b838e496e feat: fix macos 2024-08-27 02:12:24 +08:00
caorushizi ecfb2371f4 feat: macos 2024-08-27 01:11:00 +08:00
caorushizi 899afc156e build: 🛠 upload artifact 2024-06-22 12:25:51 +08:00
caorushizi 2a3ad325c2 build: 🛠 portable 2024-06-22 12:11:19 +08:00
caorushizi 8f54ebeb3a fix: 🐛 pnpm actions 2024-05-26 15:30:34 +08:00
caorushizi 660f9c7c9b feat: support linux 2024-05-25 03:02:49 +08:00
士子☀️ 960973302e ci: 🎡 github actions 2024-05-02 18:58:01 +08:00
士子☀️ dba73fc473 ci: 🎡 modify github actions 2024-05-02 18:30:24 +08:00
士子☀️ 6d459e0692 feat: rename mediago 2024-04-05 23:09:30 +08:00
士子☀️ d87fc4a400 feat: update actions version 2024-02-27 01:03:26 +08:00