add release

This commit is contained in:
Simplxs 2024-05-10 19:10:07 +08:00
parent 1a0d28b514
commit b12c2206b8
6 changed files with 143 additions and 87 deletions

View File

@ -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

View File

@ -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

36
.github/workflows/release.yml vendored Normal file
View File

@ -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

8
CHANGELOG.md Normal file
View File

@ -0,0 +1,8 @@
# v1.0.0
QQ Version: Windows 9.9.9-23424 / Linux 3.2.7-23361
## 提高系统的稳定性
## 优化系统的流畅度

View File

@ -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")

View File

@ -11,7 +11,7 @@
// #define _LINUX_PLATFORM_
// #define _WIN_PLATFORM_
#define _X64_ARCH_
// #define _X64_ARCH_
#if defined(_WIN_PLATFORM_)
#include <Windows.h>
@ -50,6 +50,9 @@ std::map<std::string, uint64_t> addrMap = {
{"3.1.2-12912", 0x33C38E0},
{"3.1.2-13107", 0x33C3920},
{"3.2.7-23361", 0x4C93C57}};
#elif defined(_ARM64_ARCH_)
std::map<std::string, uint64_t> addrMap = {
{"3.2.7-23361", 0x4C93C57}};
#endif
#endif