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
52 changes: 52 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Dev CI

on:
push:
branches:
- dev
workflow_dispatch:

concurrency:
group: dev-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-22.04]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: yarn
cache-dependency-path: yarn.lock

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: |
src-tauri -> src-tauri/target

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

118 changes: 118 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Preview Prerelease

on:
pull_request:
types: [closed]
branches:
- preview
workflow_dispatch:

permissions:
contents: write

concurrency:
group: preview-prerelease
cancel-in-progress: false

jobs:
prepare:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'preview' && github.event.pull_request.head.ref == 'dev')
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.vars.outputs.tag_name }}
app_version: ${{ steps.vars.outputs.app_version }}

steps:
- name: Checkout (preview)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: preview

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Bump version, commit and tag
id: vars
shell: pwsh
run: |
$pkg = Get-Content -Raw package.json | ConvertFrom-Json
$baseVersion = [string]$pkg.version
if ($baseVersion.Contains("-")) { $baseVersion = $baseVersion.Split("-", 2)[0] }

$shortSha = (git rev-parse --short=7 HEAD).Trim()
$epoch = [int64](Get-Date -AsUTC -UFormat %s)
$hex = ("{0:x}" -f $epoch)
$preVersion = "$baseVersion-pre.$hex.$shortSha"
$tag = "v$preVersion"

if ((git ls-remote --tags origin "refs/tags/$tag")) {
throw "Tag already exists on origin: $tag"
}

./scripts/set-version.ps1 -Version $preVersion
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml
git commit -m "chore(version): 更新版本号为 $preVersion"
git tag $tag

git push origin preview
git push origin $tag

"tag_name=$tag" >> $env:GITHUB_OUTPUT
"app_version=$preVersion" >> $env:GITHUB_OUTPUT

build:
needs: prepare
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-22.04]

steps:
- name: Checkout (tag)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.prepare.outputs.tag_name }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: yarn
cache-dependency-path: yarn.lock

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: |
src-tauri -> src-tauri/target

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf

- name: Install frontend dependencies
run: yarn install --frozen-lockfile

- name: Quick web build
run: yarn build

- name: Build Tauri app and publish prerelease assets
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: .
releaseDraft: false
prerelease: true
tagName: ${{ needs.prepare.outputs.tag_name }}
releaseName: EndCat ${{ needs.prepare.outputs.tag_name }}
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release Draft

on:
pull_request:
types: [closed]
branches:
- master
workflow_dispatch:

permissions:
contents: write

concurrency:
group: master-release
cancel-in-progress: false

jobs:
prepare:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'preview')
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.vars.outputs.tag_name }}
app_version: ${{ steps.vars.outputs.app_version }}

steps:
- name: Checkout (master)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Bump version, commit and tag
id: vars
shell: pwsh
run: |
$pkg = Get-Content -Raw package.json | ConvertFrom-Json
$current = [string]$pkg.version
$releaseVersion = $current
if ($releaseVersion.Contains("-")) { $releaseVersion = $releaseVersion.Split("-", 2)[0] }

$tag = "v$releaseVersion"
if ((git ls-remote --tags origin "refs/tags/$tag")) {
throw "Tag already exists on origin: $tag"
}

./scripts/set-version.ps1 -Version $releaseVersion
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml
git commit -m "chore(version): 更新版本号为 $releaseVersion"
git tag $tag

git push origin master
git push origin $tag

"tag_name=$tag" >> $env:GITHUB_OUTPUT
"app_version=$releaseVersion" >> $env:GITHUB_OUTPUT

build:
needs: prepare
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-22.04]

steps:
- name: Checkout (tag)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.prepare.outputs.tag_name }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: yarn
cache-dependency-path: yarn.lock

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: |
src-tauri -> src-tauri/target

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf

- name: Install frontend dependencies
run: yarn install --frozen-lockfile

- name: Quick web build
run: yarn build

- name: Build Tauri app and create draft release
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: .
releaseDraft: true
prerelease: false
tagName: ${{ needs.prepare.outputs.tag_name }}
releaseName: EndCat ${{ needs.prepare.outputs.tag_name }}
72 changes: 0 additions & 72 deletions .github/workflows/tauri.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ endfield-cat-metadata

# Local TLS certs (self-signed)
/certs/*
scripts
scripts

findings.md
progress.md
task_plan.md
Loading
Loading