-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from 0xBLCKLPTN/alice_database-dev
Alice database v2 Library
- Loading branch information
Showing
25 changed files
with
18,170 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,80 @@ | ||
name: Versioning | ||
name: Update Version | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-version: | ||
update_version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Read current version | ||
id: get_version | ||
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | ||
|
||
- name: Increment version | ||
|
||
- name: Get commit count and last commit hash | ||
id: get_info | ||
run: | | ||
COMMIT_COUNT=$(git rev-list --count HEAD) | ||
echo "commit_count=$COMMIT_COUNT" >> $GITHUB_ENV | ||
echo "last_commit_hash=$LAST_COMMIT_HASH" >> $GITHUB_ENV | ||
- name: Create VERSION file | ||
run: | | ||
IFS='.' read -r major minor patch <<< "$VERSION" | ||
new_patch=$((patch + 1)) | ||
new_version="$major.$minor.$new_patch" | ||
echo "$new_version" > VERSION | ||
echo "New version: $new_version" | ||
# Формируем версию | ||
echo "$VERSION" > VERSION | ||
- name: Commit and push changes | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git add VERSION | ||
git commit -m "Bump version to $new_version" | ||
git commit -m "Update VERSION file" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: Update Version | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get current version | ||
id: get_version | ||
run: | | ||
LAST_COMMIT_HASH=$(git rev-parse HEAD) # Получаем полный хеш | ||
VERSION=$(cat VERSION) | ||
echo "Current version: $VERSION" | ||
echo "::set-output name=current_version::$VERSION" | ||
- name: Increment version | ||
id: increment_version | ||
run: | | ||
IFS='.' read -r major minor patch <<< "${{ steps.get_version.outputs.current_version }}" | ||
new_patch=$((patch + 1)) | ||
new_version="$major.$minor.$new_patch" | ||
echo "New version: $new_version" | ||
echo "$new_version" > VERSION | ||
echo "::set-output name=new_version::$new_version" | ||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add VERSION | ||
git commit -m "Update version to ${{ steps.increment_version.outputs.new_version }}" || echo "No changes to commit" | ||
git push |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.x86_64-pc-windows-gnu] | ||
linker = "x86_64-w64-mingw32-gcc" | ||
|
||
[target.x86_64-apple-darwin] | ||
linker = "clang" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
visibility = ["//visibility:public"] | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test", "rust_library") | ||
load("@crate_index//:defs.bzl", "aliases", "all_crate_deps") | ||
|
||
|
||
rust_library( | ||
name = "alice_db_lib", | ||
|
||
# Specifies the source file for the binary. | ||
srcs = glob([ | ||
"src/*.rs", | ||
"src/**/*.rs", | ||
]), | ||
aliases = aliases(), | ||
#proc_macro_deps = all_crate_deps(), | ||
#deps = [ | ||
# all_crate_deps(normal=True) | ||
#], | ||
deps = all_crate_deps(normal = True), | ||
# Specifies the Rust edition to use for this binary. | ||
edition = "2021" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(AliceDatabase) | ||
|
||
# Укажите целевую платформу | ||
set(TARGET_PLATFORM_WINDOWS "x86_64-pc-windows-gnu" CACHE STRING "Target platform") | ||
set(TARGET_PLATFORM_OSX "x86_64-apple-darwin" CACHE STRING "Target platform") | ||
# Явно укажите путь к Rust, если find_program не работает | ||
set(CARGO_PATH "cargo") # Замените на фактический путь к rustc | ||
|
||
# Определите команды сборки Rust | ||
add_custom_target(RustBuild ALL | ||
COMMAND ${CARGO_PATH} build --release --target=${TARGET_PLATFORM_WINDOWS} | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
COMMENT "Building Rust project for ${TARGET_PLATFORM}" | ||
) | ||
add_custom_target(RustBuildOSX ALL | ||
COMMAND ${CARGO_PATH} build --release --target=${TARGET_PLATFORM_OSX} | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
COMMENT "Building Rust project for ${TARGET_PLATFORM}" | ||
) | ||
|
||
add_custom_target(RustClean | ||
COMMAND ${CARGO_PATH} clean | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
COMMENT "Cleaning Rust project" | ||
) |
Oops, something went wrong.