From 81434d41d8373c99c41ee5ba8bdc30a742522b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:54:28 +0800 Subject: [PATCH 1/6] Update main.rs --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e09eb7c..2261c25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -203,7 +203,7 @@ fn main() -> Result<(), Box> { let args = if cfg!(debug_assertions) { Args { - cipher_suite: CipherSuite::RSA3072, + cipher_suite: CipherSuite::Ed25519, user_id: String::from("Dummy "), pattern: Some(String::from("XXXYYYZZZWWW")), filter: None, From 1a92ca4fb14726ea02c3291f793c07fffd6970c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:54:33 +0800 Subject: [PATCH 2/6] Create build.yml --- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..751111a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,53 @@ +name: build + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + # - macos-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + - uses: Swatinem/rust-cache@v2 + - name: Prepare OpenCL SDK + shell: bash + run: | + if [[ "$RUNNER_OS" == "Windows" ]]; then + VERSION=$(gh release view --repo KhronosGroup/OpenCL-SDK --json tagName --jq .tagName) + gh release download --repo KhronosGroup/OpenCL-SDK --pattern "OpenCL-SDK-${VERSION}-Win-x64.zip" + unzip "OpenCL-SDK-${VERSION}-Win-x64.zip" + cp "OpenCL-SDK-${VERSION}-Win-x64/lib/OpenCL.lib" OpenCL.lib + fi + if [[ "$RUNNER_OS" == "Linux" ]]; then + apt install opencl-headers ocl-icd-opencl-dev + fi + if [ $BUILD_OS == "macOS" ]; then + # FIXME + fi + - name: Build + shell: bash + id: build + run: | + cargo build --release + if [[ "$RUNNER_OS" == "Windows" ]]; then + echo "executable=target/release/opencl_vanity_gpg.exe" >> $GITHUB_OUTPUT + else + echo "executable=target/release/opencl_vanity_gpg" >> $GITHUB_OUTPUT + fi + - name: Upload result + uses: actions/upload-artifact@v4 + with: + name: opencl_vanity_gpg-${{ runner.os }} + path: ${{ steps.build.outputs.executable }} From 73e8502e3e06a9f76f418922f9982bf1e549b323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:55:57 +0800 Subject: [PATCH 3/6] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 751111a..bdc3cc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: cp "OpenCL-SDK-${VERSION}-Win-x64/lib/OpenCL.lib" OpenCL.lib fi if [[ "$RUNNER_OS" == "Linux" ]]; then - apt install opencl-headers ocl-icd-opencl-dev + sudo apt install opencl-headers ocl-icd-opencl-dev fi if [ $BUILD_OS == "macOS" ]; then # FIXME From c870fbe521fcae2eac9c9cad198e9c727e66aaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:57:56 +0800 Subject: [PATCH 4/6] Update build.yml --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdc3cc6..eee6038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,10 @@ jobs: if [[ "$RUNNER_OS" == "Linux" ]]; then sudo apt install opencl-headers ocl-icd-opencl-dev fi - if [ $BUILD_OS == "macOS" ]; then - # FIXME - fi + # FIXME + # if [[ "$RUNNER_OS" == "macOS" ]]; then + # + # fi - name: Build shell: bash id: build From 880a43754763f847621a127811e2d5ff998257c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Thu, 9 Jan 2025 00:02:45 +0800 Subject: [PATCH 5/6] Update build.yml --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eee6038..c48d558 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Prepare OpenCL SDK shell: bash + env: + GH_TOKEN: ${{ github.token }} run: | if [[ "$RUNNER_OS" == "Windows" ]]; then VERSION=$(gh release view --repo KhronosGroup/OpenCL-SDK --json tagName --jq .tagName) @@ -38,10 +40,10 @@ jobs: # # fi - name: Build - shell: bash id: build + shell: bash run: | - cargo build --release + RUSTFLAGS="--remap-path-prefix $HOME=~" cargo build --release if [[ "$RUNNER_OS" == "Windows" ]]; then echo "executable=target/release/opencl_vanity_gpg.exe" >> $GITHUB_OUTPUT else From f4e4050ef8240b135a2ace502b58e528576dff50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Thu, 9 Jan 2025 00:28:35 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 7 ++++++- README.md | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c48d558..5dacfb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,12 @@ jobs: id: build shell: bash run: | - RUSTFLAGS="--remap-path-prefix $HOME=~" cargo build --release + if [[ "$RUNNER_OS" == "Windows" ]]; then + export RUSTFLAGS="--remap-path-prefix C:\\Users\\runneradmin=~" + else + export RUSTFLAGS="--remap-path-prefix $HOME=~" + fi + cargo build --release if [[ "$RUNNER_OS" == "Windows" ]]; then echo "executable=target/release/opencl_vanity_gpg.exe" >> $GITHUB_OUTPUT else diff --git a/README.md b/README.md index c0841c0..8436707 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ 目前最好的同类工具是使用 CPU 的 [RedL0tus/VanityGPG](https://github.com/RedL0tus/VanityGPG) 和使用 GPU(CUDA)的 [cuihaoleo/gpg-fingerprint-filter-gpu](https://github.com/cuihaoleo/gpg-fingerprint-filter-gpu)。这个项目是使用 GPU(OpenCL)实现的,优点当然是开箱即用了。 -> TODO: GitHub Actions 自动编译 +GitHub Actions 有自动编译好的二进制文件。 # 使用方法