diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 922cbb2..5fabae6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -3,6 +3,17 @@ name: Publish Docker image on: push: tags: ['v*', 'MediaStationGo-v*'] + workflow_dispatch: + inputs: + version: + description: 'Image tag to publish, for example MediaStationGo-v0.0.32' + required: true + type: string + ref: + description: 'Git ref to build from' + required: false + default: main + type: string permissions: contents: read @@ -11,8 +22,12 @@ permissions: jobs: docker: runs-on: ubuntu-latest + env: + RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }} - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 @@ -31,7 +46,7 @@ jobs: images: ghcr.io/shukebta/mediastation-go tags: | type=raw,value=latest - type=ref,event=tag + type=raw,value=${{ env.RELEASE_VERSION }} - name: Build & push uses: docker/build-push-action@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 695fdff..759fd1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,17 @@ name: Publish release packages on: push: tags: ['v*', 'MediaStationGo-v*'] + workflow_dispatch: + inputs: + version: + description: 'Release tag to publish, for example MediaStationGo-v0.0.32' + required: true + type: string + ref: + description: 'Git ref to build from' + required: false + default: main + type: string permissions: contents: write @@ -10,10 +21,13 @@ permissions: jobs: release: runs-on: ubuntu-latest + env: + RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }} - uses: actions/setup-go@v5 with: @@ -29,7 +43,7 @@ jobs: - name: Build release packages run: ./scripts/package-release.sh env: - VERSION: ${{ github.ref_name }} + VERSION: ${{ env.RELEASE_VERSION }} - name: Generate checksums run: | @@ -44,6 +58,8 @@ jobs: dist-release/*.zip dist-release/SHA256SUMS.txt generate_release_notes: true + tag_name: ${{ env.RELEASE_VERSION }} + target_commitish: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.sha }} # GitHub immutable releases reject deleting/replacing existing assets. # Keep reruns idempotent by skipping same-name assets instead of # deleting them first. diff --git a/README.md b/README.md index f86f3fe..41a4220 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ MediaStationGo 采用完全开源路线,核心媒体库、刮削、播放、 | 下载联动 | qBittorrent / PT Site Adapter | 站点搜索、订阅、下载任务展示与脱敏 | | 外部兼容 | Emby-style API / DLNA | 面向外部播放器与三端客户端 | | 部署 | Docker / Docker Compose / Shell / PowerShell | NAS、Linux、Windows 均可部署 | -| CI/CD | GitHub Actions / GHCR | 仅版本标签触发多架构镜像与 Release 包发布 | +| CI/CD | GitHub Actions / GHCR | 版本标签或手动 Actions 自动发布多架构镜像与 Release 包 | --- @@ -238,7 +238,7 @@ mkdir -p data cache media downloads ```bash cat > .env <<'EOF' # 固定版本;需要升级时改成新的 MediaStationGo-vX.Y.Z 后执行 docker compose pull && docker compose up -d -MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 MEDIASTATION_HTTP_PORT=18080 # 程序数据和缓存建议放在 MediaStationGo 部署目录下,便于备份和迁移。 @@ -307,7 +307,7 @@ vim docker-compose.yml # # 镜像版本: # 默认拉取 latest;如需固定版本,创建 .env 并写入: -# MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +# MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 # # 路径映射总览: # /data 程序数据目录。保存 SQLite 数据库、JWT secret、系统配置等,必须持久化。 @@ -516,7 +516,7 @@ docker compose up -d ```bash cat > .env <<'EOF' -MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 MEDIASTATION_HTTP_PORT=18080 MEDIASTATION_DATA_DIR=./data MEDIASTATION_CACHE_DIR=./cache @@ -779,26 +779,26 @@ cd MediaStationGo | 平台 | 包名示例 | | --- | --- | -| Linux x86_64 | `MediaStationGo-v0.0.31-linux-amd64.tar.gz` | -| Linux ARM64 | `MediaStationGo-v0.0.31-linux-arm64.tar.gz` | -| Windows x86_64 | `MediaStationGo-v0.0.31-windows-amd64.zip` | -| macOS Intel | `MediaStationGo-v0.0.31-darwin-amd64.tar.gz` | -| macOS Apple Silicon | `MediaStationGo-v0.0.31-darwin-arm64.tar.gz` | +| Linux x86_64 | `MediaStationGo-v0.0.32-linux-amd64.tar.gz` | +| Linux ARM64 | `MediaStationGo-v0.0.32-linux-arm64.tar.gz` | +| Windows x86_64 | `MediaStationGo-v0.0.32-windows-amd64.zip` | +| macOS Intel | `MediaStationGo-v0.0.32-darwin-amd64.tar.gz` | +| macOS Apple Silicon | `MediaStationGo-v0.0.32-darwin-arm64.tar.gz` | 部署步骤: ```bash # Linux 示例 -tar -xzf MediaStationGo-v0.0.31-linux-amd64.tar.gz -cd MediaStationGo-v0.0.31-linux-amd64 +tar -xzf MediaStationGo-v0.0.32-linux-amd64.tar.gz +cd MediaStationGo-v0.0.32-linux-amd64 MEDIASTATION_APP_PORT=18080 ./mediastation-go ``` Windows: ```powershell -Expand-Archive .\MediaStationGo-v0.0.31-windows-amd64.zip -cd .\MediaStationGo-v0.0.31-windows-amd64 +Expand-Archive .\MediaStationGo-v0.0.32-windows-amd64.zip +cd .\MediaStationGo-v0.0.32-windows-amd64 $env:MEDIASTATION_APP_PORT = "18080" .\mediastation-go.exe ``` diff --git a/README_EN.md b/README_EN.md index 1b89b6c..d37f404 100644 --- a/README_EN.md +++ b/README_EN.md @@ -177,7 +177,7 @@ The current base license is `GPL-3.0`, and contributions are welcome under that | Downloads | qBittorrent / PT site adapters | Search, subscriptions, task cards, private URL redaction | | Compatibility | Emby-style API / DLNA | External clients and player integrations | | Deployment | Docker / Docker Compose / Shell / PowerShell | NAS, Linux, Windows, and macOS friendly | -| CI/CD | GitHub Actions / GHCR | Multi-arch Docker images and release packages only on version tags | +| CI/CD | GitHub Actions / GHCR | Version tags or manual Actions runs publish multi-arch Docker images and release packages | --- @@ -235,7 +235,7 @@ mkdir -p data cache media downloads ```bash cat > .env <<'EOF' -MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 MEDIASTATION_HTTP_PORT=18080 MEDIASTATION_DATA_DIR=./data MEDIASTATION_CACHE_DIR=./cache @@ -344,7 +344,7 @@ For production, pin a specific release tag instead of using `latest`. Recommende ```bash cat > .env <<'EOF' -MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 MEDIASTATION_HTTP_PORT=18080 MEDIASTATION_DATA_DIR=./data MEDIASTATION_CACHE_DIR=./cache @@ -593,25 +593,25 @@ Each release provides multi-platform archives: | Platform | Package example | | --- | --- | -| Linux x86_64 | `MediaStationGo-v0.0.31-linux-amd64.tar.gz` | -| Linux ARM64 | `MediaStationGo-v0.0.31-linux-arm64.tar.gz` | -| Windows x86_64 | `MediaStationGo-v0.0.31-windows-amd64.zip` | -| macOS Intel | `MediaStationGo-v0.0.31-darwin-amd64.tar.gz` | -| macOS Apple Silicon | `MediaStationGo-v0.0.31-darwin-arm64.tar.gz` | +| Linux x86_64 | `MediaStationGo-v0.0.32-linux-amd64.tar.gz` | +| Linux ARM64 | `MediaStationGo-v0.0.32-linux-arm64.tar.gz` | +| Windows x86_64 | `MediaStationGo-v0.0.32-windows-amd64.zip` | +| macOS Intel | `MediaStationGo-v0.0.32-darwin-amd64.tar.gz` | +| macOS Apple Silicon | `MediaStationGo-v0.0.32-darwin-arm64.tar.gz` | Linux example: ```bash -tar -xzf MediaStationGo-v0.0.31-linux-amd64.tar.gz -cd MediaStationGo-v0.0.31-linux-amd64 +tar -xzf MediaStationGo-v0.0.32-linux-amd64.tar.gz +cd MediaStationGo-v0.0.32-linux-amd64 MEDIASTATION_APP_PORT=18080 ./mediastation-go ``` Windows example: ```powershell -Expand-Archive .\MediaStationGo-v0.0.31-windows-amd64.zip -cd .\MediaStationGo-v0.0.31-windows-amd64 +Expand-Archive .\MediaStationGo-v0.0.32-windows-amd64.zip +cd .\MediaStationGo-v0.0.32-windows-amd64 $env:MEDIASTATION_APP_PORT = "18080" .\mediastation-go.exe ``` diff --git a/docker-compose.yml b/docker-compose.yml index aaa466b..bfa021c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ # # 镜像版本: # 默认拉取 latest;如需固定版本,创建 .env 并写入: -# MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.31 +# MEDIASTATION_IMAGE_TAG=MediaStationGo-v0.0.32 # # 路径映射总览: # /data 程序数据目录。保存 SQLite 数据库、JWT secret、系统配置等,必须持久化。