Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e6c2025
build: 2024 Happy New Year! Update toolchain version to 2024-01-01 an…
RocsSun Jan 1, 2024
80bc086
refactor: migrate project to lib layout.
RocsSun Jan 1, 2024
ec62483
refactor: add lib and bin files.
RocsSun Jan 1, 2024
623750f
feat: create cnblogs api client wrapper for ing operate.
RocsSun Jan 12, 2024
23b42c3
feat: add query operate for ing.
RocsSun Jan 18, 2024
2ce1143
refactor: refactor ing command, add query, create, delete subcommands.
RocsSun Jan 23, 2024
199e545
fix(security): patch RUSTSEC-2024-0003 vulnerability.
RocsSun Jan 24, 2024
bbd563e
style: format code with rustfmt.
RocsSun Jan 24, 2024
00eecef
style: format code with rustfmt.
RocsSun Jan 24, 2024
a9b407d
feat: change ing default visibility from private to public.
RocsSun Jan 24, 2024
8e1160a
chore: enhance .gitignore coverage
RocsSun Jan 13, 2026
4169085
build: Update rust toolchain version
RocsSun Jan 13, 2026
d90c497
style: configure rustfmt
RocsSun Jan 13, 2026
464443e
fix: correct type mismatch between fmt::Error and anyhow::Error
RocsSun Jan 13, 2026
11e03a8
refactor: clean up code quality warnings
RocsSun Jan 13, 2026
1bb3f59
refactor: refact impl default can be derived
RocsSun Jan 13, 2026
8520329
chore: update all dependencies package version
RocsSun Jan 13, 2026
e388061
ci: update use action version
RocsSun Jan 13, 2026
9a2f453
ci: refactor metrix.strategy.target and branch-based execution
RocsSun Jan 13, 2026
7505e13
style: format code
RocsSun Jan 14, 2026
af8fca3
chore: allow reqwest default featuers
RocsSun Jan 14, 2026
d0d56c9
refactor: backup api source code
RocsSun Jan 17, 2026
685241c
refactor: abstract context for cli
RocsSun Jan 17, 2026
d2937f8
refactor: complete ing commands
RocsSun Jan 17, 2026
c07f7bc
refactor: complete auth commands
RocsSun Jan 17, 2026
f4b023b
fix: fix auth login logic
RocsSun Jan 17, 2026
04cb01f
refactor: introduce IntoAnyhowResult trait for error conversion
RocsSun Jan 17, 2026
197e183
feat: add cache data structure
RocsSun Jan 18, 2026
284cd34
fix: save token to cache file
RocsSun Jan 19, 2026
11520a1
refactor: improve list and show for post subcommands
RocsSun Jan 19, 2026
188077d
fix: thread safety for future sending and sync
RocsSun Jan 20, 2026
9f0f279
refactor(post): add show and replay subcommands
RocsSun Jan 20, 2026
071c8a5
refactor(user): rename auth command to user
RocsSun Jan 20, 2026
9d62e9a
refactor(news): improve news command
RocsSun Jan 20, 2026
d3c32ca
refactor(news): refactor fav command
RocsSun Jan 20, 2026
17c5fa5
chore: remove unnecessary println, traits and imports
RocsSun Jan 20, 2026
111b70c
refactor(cli): finish restructuring
RocsSun Jan 20, 2026
8e4d726
build: switch Rust toolchain from nightly to stable
RocsSun Jan 20, 2026
30f0239
chore(deps): remove unused dependencies
RocsSun Jan 20, 2026
6243502
fix: repair the url path for ing comment
RocsSun Jan 21, 2026
445b11e
chore: disable optimize in develop mode.
RocsSun Jan 21, 2026
828f04a
docs: update README
RocsSun Jan 21, 2026
029f136
fix(ci): repair workflow broken in e388061
RocsSun Jan 22, 2026
67a3f29
Merge branch 'dev' into refactor
RocsSun Jan 22, 2026
3ee9ba2
fix: update date handling in NewsInfo and enhance DateFormatExt for UTC
RocsSun Jan 22, 2026
959b10a
feat: clean up commented code and improve date parsing in DateFormatExt
RocsSun Jan 22, 2026
eff8a14
ci: remove the FreeBSD target from the build workflow
RocsSun Jan 22, 2026
9a3ccf3
fix(tests): correct JSON syntax in test data for NewsInfo
RocsSun Jan 22, 2026
bddb45e
ci: refactor and enhance GitHub Actions workflow
RocsSun Jan 26, 2026
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
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ runs:
- name: Build release
if: ${{ inputs.release == 'true' }}
shell: bash
run: cargo build --target ${{ inputs.target }} -r
run: cargo build --release --target ${{ inputs.target }} -r
4 changes: 3 additions & 1 deletion .github/actions/check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ runs:
- name: Audit
shell: bash
run: |
cargo install cargo-audit
if ! command -v cargo-audit &> /dev/null; then
cargo install cargo-audit
fi
cargo audit

- name: Fmt
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/make-archive/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ runs:
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive ${{ inputs.files }} ${{ inputs.out }}
Compress-Archive -Path "${{ inputs.files }}" -DestinationPath "${{ inputs.out }}"
6 changes: 1 addition & 5 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ runs:
steps:
- name: Test dev
shell: bash
run: cargo test --verbose

- name: Test release
shell: bash
run: cargo test --verbose --release
run: cargo test
110 changes: 0 additions & 110 deletions .github/workflows/build-dev.yml

This file was deleted.

102 changes: 0 additions & 102 deletions .github/workflows/build-release.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build / Development

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
commit-check:
name: Commit Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 必须,才能拿到完整 commit history

- name: Lint commits
uses: wagoid/commitlint-github-action@v6

pr-check:
needs: commit-check
name: Pull Request Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1 # 浅克隆以加快速度
persist-credentials: false

- name: Setup Rust toolchain
uses: dsherret/rust-toolchain-file@v1

- name: Fmt
run: cargo fmt --check

- name: Clippy
run: cargo clippy -- -D warnings

- name: Test
run: cargo test

- name: Build Dev
run: cargo build
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build / Release

on:
push:
branches:
- main

permissions:
contents: write


jobs:

prepare:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
should_release: ${{ steps.check.outputs.should_release }}

steps:
- uses: actions/checkout@v4

- name: Read version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version' Cargo.toml | sed 's/.*= "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Check if release exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="v${{ steps.version.outputs.version }}"
if gh release view "$TAG" >/dev/null 2>&1; then
echo "should_release=false" >> $GITHUB_OUTPUT
else
echo "should_release=true" >> $GITHUB_OUTPUT
fi

- name: Create and push tag
if: steps.check.outputs.should_release == 'true'
run: |
TAG="v${{ steps.version.outputs.version }}"
git tag "$TAG"
git push origin "$TAG"

build-release:
needs: prepare
if: needs.prepare.outputs.should_release == 'true'
name: ${{ matrix.targets.alias }}
runs-on: ${{ matrix.targets.os }}

strategy:
fail-fast: false
matrix:
targets:
- { os: macos-latest, target: aarch64-apple-darwin, alias: aarch64-apple-darwin }
- { os: macos-latest, target: x86_64-apple-darwin, alias: x86_64-apple-darwin }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, alias: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl,alias: x86_64-unknown-linux-musl}
- { os: windows-latest, target: x86_64-pc-windows-msvc, alias: x86_64-pc-windows-msvc }

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: dsherret/rust-toolchain-file@v1

- name: Setup musl-tools
if: matrix.targets.target == 'x86_64-unknown-linux-musl'
shell: bash
run: sudo apt -y install musl-tools

- name: Add target
uses: ./.github/actions/add-target
with:
target: ${{ matrix.targets.target }}

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.targets.alias }}

- name: Run build
uses: ./.github/actions/build
with:
target: ${{ matrix.targets.target }}
release: true

- name: Archive binary
uses: ./.github/actions/make-archive
with:
files: ./target/${{ matrix.targets.target }}/release/cnb${{ matrix.targets.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
out: cnb-${{ needs.prepare.outputs.version }}-${{ matrix.targets.target }}.zip

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.prepare.outputs.version }}
files: cnb-${{ needs.prepare.outputs.version }}-${{ matrix.targets.target }}.zip
Loading
Loading