8 Commits

Author SHA1 Message Date
ede41c7802 更新依赖
Some checks failed
Release / Publish to Github Releases (, macos-latest, aarch64-apple-darwin, true) (push) Has been cancelled
Release / Publish to Github Releases (, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, aarch64-unknown-linux-gnu, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, arm-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, armv7-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, i686-unknown-linux-gnu, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, x86_64-unknown-linux-gnu, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, aarch64-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, i686-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
2024-11-17 11:21:27 +08:00
6a8d2e27f4 修正 2024-11-17 11:04:54 +08:00
01536d45a4 修正 2024-11-17 10:51:31 +08:00
489a49a942 修正 2024-11-17 10:46:57 +08:00
fdf52a2660 修正build.yml 2024-11-17 10:40:09 +08:00
fc1729df7d 修改自动构建,修复少量bug
Some checks failed
Release / Publish to Github Releases (, macos-latest, aarch64-apple-darwin, true) (push) Has been cancelled
Release / Publish to Github Releases (, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, aarch64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, arm-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, armv7-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, i686-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, x86_64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, aarch64-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, i686-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
2024-11-17 10:38:38 +08:00
1124cec79e 增加token 2024-11-17 09:42:59 +08:00
da9899d491 测试自动构建 2024-11-17 09:36:11 +08:00
6 changed files with 164 additions and 96 deletions

View File

@ -1,77 +1,141 @@
name: build
name: Release
on: on:
push: push:
tags: tags:
- "v*.*.*" - "v*.*.*"
workflow_dispatch: {}
jobs: jobs:
build: release:
name: build name: Publish to Github Releases
runs-on: ${{ matrix.os }} permissions:
contents: write
outputs:
rc: ${{ steps.check-tag.outputs.rc }}
strategy: strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
archive-name: ncmmiao-linux.tar.gz
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
archive-name: ncmmiao-macos.tar.gz
- build: windows
os: windows-latest
rust: stable-x86_64-msvc
target: x86_64-pc-windows-msvc
archive-name: ncmmiao-windows.7z
fail-fast: false fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
use-cross: true
os: ubuntu-latest
cargo-flags: ""
- target: aarch64-apple-darwin
os: macos-latest
use-cross: true
cargo-flags: ""
- target: aarch64-pc-windows-msvc
os: windows-latest
use-cross: true
cargo-flags: ""
- target: x86_64-apple-darwin
os: macos-latest
cargo-flags: ""
- target: x86_64-pc-windows-msvc
os: windows-latest
cargo-flags: ""
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
use-cross: true
cargo-flags: ""
- target: i686-unknown-linux-gnu
os: ubuntu-latest
use-cross: true
cargo-flags: ""
- target: i686-pc-windows-msvc
os: windows-latest
use-cross: true
cargo-flags: ""
- target: armv7-unknown-linux-musleabihf
os: ubuntu-latest
use-cross: true
cargo-flags: ""
- target: arm-unknown-linux-musleabihf
os: ubuntu-latest
use-cross: true
cargo-flags: ""
runs-on: ${{matrix.os}}
env:
BUILD_CMD: cargo
steps: steps:
- name: Checkout repository - uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
- name: Install Rust - name: Check Tag
uses: actions-rs/toolchain@v1 id: check-tag
with: shell: bash
toolchain: ${{ matrix.rust }} run: |
profile: minimal ver=${GITHUB_REF##*/}
override: true echo "version=$ver" >> $GITHUB_OUTPUT
components: rustfmt, clippy if [[ "$ver" =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then
target: ${{ matrix.target }} echo "rc=false" >> $GITHUB_OUTPUT
- name: Test else
run: cargo test echo "rc=true" >> $GITHUB_OUTPUT
fi
- name: Install Rust Toolchain Components
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build binary - name: Install cross
run: cargo build --verbose --release --target ${{ matrix.target }} if: matrix.use-cross
env: uses: taiki-e/install-action@v2
RUST_BACKTRACE: 1 with:
tool: cross
- name: Strip binary (linux and macos) - name: Overwrite build command env variable
if: matrix.build == 'linux' || matrix.build == 'macos' if: matrix.use-cross
run: strip "target/${{ matrix.target }}/release/ncmmiao" shell: bash
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Show Version Information (Rust, cargo, GCC)
shell: bash
run: |
gcc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name: Build
shell: bash
run: $BUILD_CMD build --locked --release --target=${{ matrix.target }} ${{ matrix.cargo-flags }}
- name: Build archive - name: Build Archive
shell: bash shell: bash
run: | id: package
mkdir archive env:
# cp LICENSE README.md archive/ target: ${{ matrix.target }}
cp README.md archive/ version: ${{ steps.check-tag.outputs.version }}
cd archive run: |
if [ "${{ matrix.build }}" = "windows" ]; then set -euxo pipefail
cp "../target/${{ matrix.target }}/release/ncmmiao.exe" ./ bin=${GITHUB_REPOSITORY##*/}
# 7z a "${{ matrix.archive-name }}" LICENSE README.md ncmmiao.exe dist_dir=`pwd`/dist
7z a "${{ matrix.archive-name }}" README.md ncmmiao.exe name=$bin-$version-$target
else executable=target/$target/release/$bin
cp "../target/${{ matrix.target }}/release/ncmmiao" ./ if [[ "$RUNNER_OS" == "Windows" ]]; then
# tar -czf "${{ matrix.archive-name }}" LICENSE README.md ncmmiao executable=$executable.exe
tar -czf "${{ matrix.archive-name }}" README.md ncmmiao fi
fi mkdir $dist_dir
- name: Release archive cp $executable $dist_dir
uses: softprops/action-gh-release@v2 cd $dist_dir
if: startsWith(github.ref, 'refs/tags/') if [[ "$RUNNER_OS" == "Windows" ]]; then
with: archive=$dist_dir/$name.zip
# name: ${{ matrix.archive-name }} 7z a $archive *
files: archive/${{ matrix.archive-name }} echo "archive=dist/$name.zip" >> $GITHUB_OUTPUT
else
archive=$dist_dir/$name.tar.gz
tar -czf $archive *
echo "archive=dist/$name.tar.gz" >> $GITHUB_OUTPUT
fi
- name: Publish Archive
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: ${{ steps.package.outputs.archive }}
prerelease: ${{ steps.check-tag.outputs.rc == 'true' }}

54
Cargo.lock generated
View File

@ -238,9 +238,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.37" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
@ -289,9 +289,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.20" version = "4.5.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -299,9 +299,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.20" version = "4.5.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -323,9 +323,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
[[package]] [[package]]
name = "color_quant" name = "color_quant"
@ -357,9 +357,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.14" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -475,9 +475,9 @@ dependencies = [
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.34" version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"miniz_oxide", "miniz_oxide",
@ -710,9 +710,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.162" version = "0.2.164"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
[[package]] [[package]]
name = "libfuzzer-sys" name = "libfuzzer-sys"
@ -799,7 +799,7 @@ checksum = "07dcca13d1740c0a665f77104803360da0bdb3323ecce2e93fa2c959a6d52806"
[[package]] [[package]]
name = "ncmmiao" name = "ncmmiao"
version = "2.2.4" version = "2.2.7"
dependencies = [ dependencies = [
"aes", "aes",
"audiotags", "audiotags",
@ -1102,9 +1102,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.8" version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1140,18 +1140,18 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.214" version = "1.0.215"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.214" version = "1.0.215"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1160,9 +1160,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.132" version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -1244,18 +1244,18 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.68" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.68" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ncmmiao" name = "ncmmiao"
version = "2.2.4" version = "2.2.7"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -76,6 +76,9 @@ Options:
- 优化保存文件逻辑,保存时间缩短到毫秒 - 优化保存文件逻辑,保存时间缩短到毫秒
### Refactoring ### Refactoring
- :hammer: 重构代码! - :hammer: 重构代码!
## [2.2.4] - 2024-11-17
### Features :sparkles:
- 完整的自动构建流程!
--- ---
# 附 - ncm文件结构 # 附 - ncm文件结构

View File

@ -5,7 +5,7 @@ use clap::Parser;
#[command(author = "lkhsss")] #[command(author = "lkhsss")]
#[command(version,about = "一个解密ncm文件的神秘程序", long_about = None)] #[command(version,about = "一个解密ncm文件的神秘程序", long_about = None)]
pub struct Cli { pub struct Cli {
/// 最大线程数 约束逻辑在主函数 /// 并发的最大线程数默认为4线程
#[arg(short, long)] #[arg(short, long)]
pub workers: Option<usize>, pub workers: Option<usize>,
/// 需要解密的文件夹或文件 /// 需要解密的文件夹或文件

View File

@ -71,10 +71,11 @@ fn main() {
} }
let taskcount = undumpfile.len(); let taskcount = undumpfile.len();
if taskcount == 0 { if taskcount == 0 {
error!("没有找到有效文件") error!("没有找到有效文件。使用-i参数输入需要解密的文件或文件夹。")
} else { } else {
// 初始化线程池 // 初始化线程池
let pool = threadpool::Pool::new(max_workers); let pool = threadpool::Pool::new(max_workers);
info!("启用{}线程",max_workers);
for filepath in undumpfile { for filepath in undumpfile {
let output = outputdir.clone(); let output = outputdir.clone();