Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ permissions:
jobs:
build:
runs-on: windows-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand All @@ -27,36 +25,49 @@ jobs:
- name: Build
run: dotnet build -c Release

release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # MinVer needs full history for version calculation

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release -r win-x64 --no-self-contained -o publish/

- name: Publish (self-contained)
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release -r win-x64 --self-contained -o publish-selfcontained/

- name: Zip artifact
if: startsWith(github.ref, 'refs/tags/v')
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
$zipName = "PayBeat-$version-portable-win-x64.zip"
$zipName = "PayBeat-$version-portable-runtime-required-win-x64.zip"
Compress-Archive -Path "publish/*" -DestinationPath $zipName
echo "ZIP_NAME=$zipName" >> $env:GITHUB_ENV

- name: Zip artifact (self-contained)
if: startsWith(github.ref, 'refs/tags/v')
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
$zipNameSelfContained = "PayBeat-$version-selfcontained-win-x64.zip"
$zipNameSelfContained = "PayBeat-$version-portable-standalone-win-x64.zip"
Compress-Archive -Path "publish-selfcontained/*" -DestinationPath $zipNameSelfContained
echo "ZIP_NAME_SELFCONTAINED=$zipNameSelfContained" >> $env:GITHUB_ENV

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
name: PayBeat ${{ github.ref_name }}
files: |
${{ env.ZIP_NAME }}
${{ env.ZIP_NAME_SELFCONTAINED }}
Expand Down
9 changes: 7 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ dotnet build
# Run
dotnet run --project src/PayBeat.App/PayBeat.App.csproj

# Publish
# Publish (portable, requires .NET 10 Desktop Runtime on target machine)
dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release

# Publish (self-contained, no runtime prerequisite)
dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release -r win-x64 --self-contained
```

Output goes to `artifacts/bin/PayBeat.App/release/`.

## Architecture

WPF floating widget app (.NET 10, MVVM). Shows real-time earnings as a borderless, always-on-top window, plus a system tray icon for display-mode switching, Settings/About, and Exit.
Expand Down Expand Up @@ -69,7 +74,7 @@ Artifacts output to `artifacts/bin/<ProjectName>/<config>/` (SDK artifacts layou

## CI / Release

`.github/workflows/ci.yml` builds on every push (Windows runner, .NET 10). On a `v*` tag push, it additionally publishes a self-contained-false `win-x64` build, zips it, and creates a GitHub Release via `softprops/action-gh-release`. Versioning is derived from git tags via MinVer (e.g. `v1.2.0`); locally, ensure the tag is reachable from HEAD for a meaningful version.
`.github/workflows/ci.yml` has two jobs (Windows runner, .NET 10). `build` runs on every push and just compiles. `release` runs `needs: build` with a job-level `if: startsWith(github.ref, 'refs/tags/v')` — only on a `v*` tag push does it publish both a portable (`--no-self-contained`) and a self-contained `win-x64` build, zip each (`PayBeat-<version>-portable-runtime-required-win-x64.zip`, `PayBeat-<version>-portable-standalone-win-x64.zip`), and create a GitHub Release via `softprops/action-gh-release`. Versioning is derived from git tags via MinVer (e.g. `v1.2.0`); locally, ensure the tag is reachable from HEAD for a meaningful version.

User settings are persisted to `%APPDATA%\PayBeat\settings.json`.

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ PayBeat is a borderless, always-on-top Windows widget that shows your real-time

Grab the latest release from the [Releases page](https://github.com/coldhighsun/PayBeat/releases/latest). Two `win-x64` packages are published per version:

- `PayBeat-<version>-portable-win-x64.zip` — smaller, requires the .NET 10 Desktop Runtime
- `PayBeat-<version>-selfcontained-win-x64.zip` — larger, runs standalone with no prerequisites
- `PayBeat-<version>-portable-runtime-required-win-x64.zip` — smaller, requires the .NET 10 Desktop Runtime
- `PayBeat-<version>-portable-standalone-win-x64.zip` — larger, runs standalone with no prerequisites

## Build

Expand All @@ -62,7 +62,7 @@ dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release
dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release -r win-x64 --self-contained
```

Output goes to `artifacts/bin/PayBeat.App/release/`. CI tags produce both a `PayBeat-<version>-portable-win-x64.zip` and a `PayBeat-<version>-selfcontained-win-x64.zip` release artifact.
Output goes to `artifacts/bin/PayBeat.App/release/`. CI tags produce both a `PayBeat-<version>-portable-runtime-required-win-x64.zip` and a `PayBeat-<version>-portable-standalone-win-x64.zip` release artifact.

## Usage

Expand Down Expand Up @@ -132,8 +132,8 @@ PayBeat 是一款 Windows 桌面悬浮组件,以秒为单位实时显示当天

前往 [Releases 页面](https://github.com/coldhighsun/PayBeat/releases/latest) 下载最新版本。每个版本会发布两个 `win-x64` 压缩包:

- `PayBeat-<version>-portable-win-x64.zip` — 体积较小,需预装 .NET 10 Desktop Runtime
- `PayBeat-<version>-selfcontained-win-x64.zip` — 体积较大,内置运行时,无需任何前置依赖
- `PayBeat-<version>-portable-runtime-required-win-x64.zip` — 体积较小,需预装 .NET 10 Desktop Runtime
- `PayBeat-<version>-portable-standalone-win-x64.zip` — 体积较大,内置运行时,无需任何前置依赖

## 构建

Expand All @@ -151,7 +151,7 @@ dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release
dotnet publish src/PayBeat.App/PayBeat.App.csproj -c Release -r win-x64 --self-contained
```

产物输出至 `artifacts/bin/PayBeat.App/release/`。CI 打标签时会同时生成 `PayBeat-<version>-portable-win-x64.zip` 和 `PayBeat-<version>-selfcontained-win-x64.zip` 两个发布包。
产物输出至 `artifacts/bin/PayBeat.App/release/`。CI 打标签时会同时生成 `PayBeat-<version>-portable-runtime-required-win-x64.zip` 和 `PayBeat-<version>-portable-standalone-win-x64.zip` 两个发布包。

## 使用

Expand Down
Loading