From b12c2206b8b2edca23a74332db524be7980811d6 Mon Sep 17 00:00:00 2001 From: Simplxs Date: Fri, 10 May 2024 19:10:07 +0800 Subject: [PATCH] add release --- .github/workflows/build.yml | 162 +++++++++++++-------------- .github/workflows/docker-publish.yml | 12 +- .github/workflows/release.yml | 36 ++++++ CHANGELOG.md | 8 ++ CMakeLists.txt | 7 ++ src/sign.cpp | 5 +- 6 files changed, 143 insertions(+), 87 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7c4559..6861f76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,93 +1,93 @@ # https://docs.github.com/en/actions/learn-github-actions/contexts ---- - name: SignerServer - on: - push: - branches: - - main - pull_request: - workflow_dispatch: +name: SignerServer +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + workflow_call: - jobs: - windows: - name: run on ${{ matrix.os }}(${{ matrix.arch }}) - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - arch: [x64] - steps: - - name: Checkout repository - uses: actions/checkout@v4 +jobs: + windows: + name: run on ${{ matrix.os }}(${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest] + arch: [x64] + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup cmake - uses: lukka/get-cmake@latest + - name: Setup cmake + uses: lukka/get-cmake@latest + + - name: Build project + uses: lukka/run-cmake@v10 + with: + # This is the default path to the CMakeLists.txt along side the + # CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json + # located elsewhere. + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - - name: Build project - uses: lukka/run-cmake@v10 - with: - # This is the default path to the CMakeLists.txt along side the - # CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json - # located elsewhere. - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - - # This is the name of the CMakePresets.json's configuration to use to generate - # the project files. This configuration leverages the vcpkg.cmake toolchain file to - # run vcpkg and install all dependencies specified in vcpkg.json. - configurePreset: 'msvc-${{ matrix.arch }}' - - # This is the name of the CMakePresets.json's configuration to build the project. - buildPreset: 'msvc-${{ matrix.arch }}-release' + # This is the name of the CMakePresets.json's configuration to use to generate + # the project files. This configuration leverages the vcpkg.cmake toolchain file to + # run vcpkg and install all dependencies specified in vcpkg.json. + configurePreset: 'msvc-${{ matrix.arch }}' + + # This is the name of the CMakePresets.json's configuration to build the project. + buildPreset: 'msvc-${{ matrix.arch }}-release' - - run: mv build/msvc-${{ matrix.arch }}/Release/SignerServer.dll SignerServer.dll + - run: mv build/msvc-${{ matrix.arch }}/Release/SignerServer.dll SignerServer.dll - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: SignerServer-${{ matrix.os }}-${{ matrix.arch }} - path: | - SignerServer.dll - load.js - start.sh + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: SignerServer-${{ matrix.os }}-${{ matrix.arch }} + path: | + SignerServer.dll + load.js + start.sh - ubuntu: - name: run on ${{ matrix.os }}(${{ matrix.arch }}) - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - arch: [x64, arm64] - steps: - - name: Checkout repository - uses: actions/checkout@v4 + ubuntu: + name: run on ${{ matrix.os }}(${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + arch: [x64, arm64] + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup cmake - uses: lukka/get-cmake@latest + - name: Setup cmake + uses: lukka/get-cmake@latest + + - name: Build project + uses: lukka/run-cmake@v10 + with: + # This is the default path to the CMakeLists.txt along side the + # CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json + # located elsewhere. + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - - name: Build project - uses: lukka/run-cmake@v10 - with: - # This is the default path to the CMakeLists.txt along side the - # CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json - # located elsewhere. - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - - # This is the name of the CMakePresets.json's configuration to use to generate - # the project files. This configuration leverages the vcpkg.cmake toolchain file to - # run vcpkg and install all dependencies specified in vcpkg.json. - configurePreset: 'ninja' - - # This is the name of the CMakePresets.json's configuration to build the project. - buildPreset: 'ninja-release' + # This is the name of the CMakePresets.json's configuration to use to generate + # the project files. This configuration leverages the vcpkg.cmake toolchain file to + # run vcpkg and install all dependencies specified in vcpkg.json. + configurePreset: 'ninja' + + # This is the name of the CMakePresets.json's configuration to build the project. + buildPreset: 'ninja-release' - - run: mv build/ninja/libSignerServer.so libSignerServer.so + - run: mv build/ninja/libSignerServer.so libSignerServer.so - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: SignerServer-${{ matrix.os }}-${{ matrix.arch }} - path: | - libSignerServer.so - load.js - start.sh + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: SignerServer-${{ matrix.os }}-${{ matrix.arch }} + path: | + libSignerServer.so + load.js + start.sh diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1d0d71d..5dfdfa6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,8 +1,14 @@ +# https://docs.github.com/en/actions/learn-github-actions/contexts + name: docker-publish on: workflow_dispatch: +env: + DOCKER_REPO: simplxs/signerserver + GITHUB_REPO: Simplxss/SignerServer + jobs: publish-dockerhub: runs-on: ubuntu-latest @@ -21,11 +27,8 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} # Fork from https://github.com/koishijs/boilerplate/blob/master/.github/workflows/docker.yml - name: Run buildx and push - env: - DOCKER_REPO: mlikiowa/napcat-docker - GITHUB_REPO: NapNeko/NapCatQQ run: | - TAG=$(curl "https://api.github.com/repos/NapNeko/NapCatQQ/releases/latest" | jq -r '.tag_name') + TAG=$(curl "https://api.github.com/repos/${GITHUB_REPO}/releases/latest" | jq -r '.tag_name') docker buildx build \ --output "type=image,push=true" \ --platform linux/amd64,linux/arm64 \ @@ -34,5 +37,4 @@ jobs: --file ./Dockerfile \ . - name: Docker Hub logout - if: always() run: docker logout \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3818477 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +# https://docs.github.com/en/actions/learn-github-actions/contexts + +name: "release" + +on: + push: + tags: + - "v*" + +permissions: write-all + +jobs: + build: + uses: ./.github/workflows/build.yml + + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download All Artifact + uses: actions/download-artifact@v4 + + - name: Create Release Draft and Upload Artifacts + uses: softprops/action-gh-release@v1 + with: + name: SignerServer V${{ env.VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + body_path: CHANGELOG.md + files: | + SignerServer-windows-latest-x64.zip + SignerServer-ubuntu-latest-x64.zip + SignerServer-ubuntu-latest-arm64.zip + draft: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6bf9863 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# v1.0.0 + +QQ Version: Windows 9.9.9-23424 / Linux 3.2.7-23361 + +## 提高系统的稳定性 + + +## 优化系统的流畅度 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 828df88..cfd8612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,13 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") add_definitions(-D _LINUX_PLATFORM_) endif() +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "IA64") + add_definitions(-D _X64_ARCH_) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + add_definitions(-D _X86_ARCH_) +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + add_definitions(-D _ARM64_ARCH_) +endif() file(GLOB SOURCE_FILES "./src/*.cpp" "./src/*.asm") diff --git a/src/sign.cpp b/src/sign.cpp index 3c5477d..bb467e4 100644 --- a/src/sign.cpp +++ b/src/sign.cpp @@ -11,7 +11,7 @@ // #define _LINUX_PLATFORM_ // #define _WIN_PLATFORM_ -#define _X64_ARCH_ +// #define _X64_ARCH_ #if defined(_WIN_PLATFORM_) #include @@ -50,6 +50,9 @@ std::map addrMap = { {"3.1.2-12912", 0x33C38E0}, {"3.1.2-13107", 0x33C3920}, {"3.2.7-23361", 0x4C93C57}}; +#elif defined(_ARM64_ARCH_) +std::map addrMap = { + {"3.2.7-23361", 0x4C93C57}}; #endif #endif