aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-10-17 23:58:34 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-10-17 23:58:34 -0400
commit6a4a464d9fdc7821cd5c5695656a3fe385497cc5 (patch)
treeee4909480e48024a4bb1f84bf1be78cbdfd01e10
parent1a2429666994fa94899b1310d8aeb3f59764ed41 (diff)
parentdc47d096400e7a4d95dd9516c72876c8ad016dcb (diff)
merge develop
-rw-r--r--.onedev-buildspec.yml108
-rw-r--r--CHANGELOG.md11
-rw-r--r--Module.Taskfile.yaml8
-rw-r--r--Taskfile.yaml107
4 files changed, 169 insertions, 65 deletions
diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml
index 8049766..8bbe9c7 100644
--- a/.onedev-buildspec.yml
+++ b/.onedev-buildspec.yml
@@ -1,6 +1,6 @@
-version: 33
+version: 36
jobs:
-- name: GitHub Push
+- name: Git mirror push
steps:
- !PushRepository
name: Github push sync
@@ -25,22 +25,102 @@ jobs:
maxRetries: 3
retryDelay: 30
timeout: 3600
-- name: GitHub Pull
+
+- name: Unit Testing
steps:
- - !PullRepository
- name: GitHub sync pull
- remoteUrl: https://github.com/VnUgE/noscrypt.git
- userName: VnUgE
- passwordSecret: github-access-token
- refs: refs/heads/* refs/tags/*
+ - !CheckoutStep
+ name: checkout
+ cloneCredential: !DefaultCredential {}
withLfs: false
- force: false
+ withSubmodules: false
+ checkoutPath: '@project_name@'
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ - !CommandStep
+ name: run unit tests
+ runInContainer: false
+ interpreter: !DefaultInterpreter
+ commands: |
+ cd @project_name@
+ task -t Module.Taskfile.yaml test
+ useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- - !ScheduleTrigger
- cronExpression: 0 15 10 ? * *
- projects: noscrypt
+ - !BranchUpdateTrigger
+ branches: '** -master'
retryCondition: never
maxRetries: 3
retryDelay: 30
- timeout: 3600
+ timeout: 14400
+- name: Staging build
+ steps:
+ - !CheckoutStep
+ name: checkout
+ cloneCredential: !DefaultCredential {}
+ withLfs: false
+ withSubmodules: false
+ checkoutPath: '@project_name@'
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ - !CommandStep
+ name: VNBuild build
+ runInContainer: false
+ interpreter: !DefaultInterpreter
+ commands: |
+ vnbuild build -S --verbose
+ useTTY: true
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ - !CommandStep
+ name: VNBuild mock publish
+ runInContainer: false
+ interpreter: !DefaultInterpreter
+ commands: |
+ vnbuild publish --sign
+ useTTY: true
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ triggers:
+ - !BranchUpdateTrigger
+ branches: develop master
+ jobDependencies:
+ - jobName: Unit Testing
+ requireSuccessful: true
+ retryCondition: never
+ maxRetries: 3
+ retryDelay: 30
+ timeout: 14400
+
+- name: Publish on tag
+ steps:
+ - !CheckoutStep
+ name: checkout
+ cloneCredential: !DefaultCredential {}
+ withLfs: false
+ withSubmodules: false
+ checkoutPath: '@project_name@'
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ - !CommandStep
+ name: VNBuild build
+ runInContainer: false
+ interpreter: !DefaultInterpreter
+ commands: |
+ vnbuild build -S --verbose
+ useTTY: true
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ - !CommandStep
+ name: VNBuild publish
+ runInContainer: false
+ interpreter: !DefaultInterpreter
+ commands: |
+ vnbuild publish --ftp "@secret:ftp_server_address@" --sign
+ envVars:
+ - name: FTP_USERNAME
+ value: '@secret:ftp_username@'
+ - name: FTP_PASSWORD
+ value: '@secret:ftp_password@'
+ useTTY: true
+ condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
+ triggers:
+ - !TagCreateTrigger
+ branches: master
+ retryCondition: never
+ maxRetries: 3
+ retryDelay: 30
+ timeout: 14400
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e519972..563b347 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,12 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- C# .NET 8.0 library wrapper for noscrypt
-- NIP44 vector testing for encryption
+- Full NIP44 vector testing for encryption
+
+## [0.1.5]
+
+### Added
- `NCUtilContextAlloc()` and `NCUtilContextFree()` utilities for dynamic library context allocation
### Changed
- Public and Secret key structure definition names have been correctly namespaced __(no breaking changes)__
-
+
## [0.1.4]
### Fixed
@@ -73,7 +77,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- NCContext structure defintion.
- Internal headers from the public include directory.
-[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...HEAD
+[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.5...HEAD
+[0.1.5]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/VnUgE/noscrypt/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/VnUgE/noscrypt/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/VnUgE/noscrypt/compare/v0.1.1...v0.1.2
diff --git a/Module.Taskfile.yaml b/Module.Taskfile.yaml
index d31449a..b7b991c 100644
--- a/Module.Taskfile.yaml
+++ b/Module.Taskfile.yaml
@@ -17,11 +17,16 @@ tasks:
cmds:
- git reset --hard
- git remote update
- - git pull origin {{.BRANCH_NAME}} --verify-signatures
+ - git pull origin {{ .BRANCH_NAME }} --verify-signatures
#updates the project versions for all inlcuded .NET projects
- dotnet-gitversion.exe /updateprojectfiles
+ test:
+ desc: 'Builds and runs noscrypt unit tests for vnbuild CI systems'
+ cmds:
+ - cmd: task test -- -DNC_ENABLE_UTILS=ON
+ - cmd: wsl task test -- -DNC_ENABLE_UTILS=ON
#called by build pipeline to build module
build:
@@ -33,7 +38,6 @@ tasks:
#git archive in the module directory
- git archive --format {{.ARCHIVE_FILE_FORMAT}} --output {{.ARCHIVE_FILE_NAME}} HEAD
-
#called by build pipeline to clean module
clean:
cmds:
diff --git a/Taskfile.yaml b/Taskfile.yaml
index f66a6f9..b19a135 100644
--- a/Taskfile.yaml
+++ b/Taskfile.yaml
@@ -15,6 +15,7 @@ version: '3'
vars:
CMAKE_BUILD_DIR: 'build/{{ OS }}'
TEST_EXE_NAME: 'nctest'
+ CI_BUILD_CONFIG: '{{ .CI_BUILD_CONFIG | default "Release" }}'
tasks:
@@ -35,7 +36,7 @@ tasks:
desc: "Builds a local copy of the library in a debug configuration, then runs the test executable"
cmds:
- task: build-debug
- - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose
+ - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose
test-mbedtls:
desc: "Builds and runs tests for noscrypt using the mbedtls crypto library for the current platform"
@@ -44,42 +45,45 @@ tasks:
vars:
CMAKE_TEST_STATUS: 'ON'
BUILD_CONFIG: 'Debug'
- CLI_ARGS: '-DNC_FETCH_MBEDTLS=ON {{.CLI_ARGS}}' #fetches and enabled medtls
- - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose
+ CLI_ARGS: '-DNC_FETCH_MBEDTLS=ON {{ .CLI_ARGS }}' #fetches and enabled medtls
+
+ - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose
test-dev:
desc: "Re-runs compilation phase and test execution"
cmds:
- task: compile
vars: { BUILD_CONFIG: 'Debug' }
- - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose --output-on-failure
-
- test-full:
- desc: '(dotnet required) builds, and tests noscrypt using the .NET library test suite'
- cmds:
- - task: test
- - cmd: dotnet test --logger 'console;verbosity=detailed'
-
- compile:
- internal: true
- cmds:
- - cmake --build {{.CMAKE_BUILD_DIR}} --config {{.BUILD_CONFIG}}
+ - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose --output-on-failure
build-internal:
internal: true
cmds:
- - cmake -S . -B{{.CMAKE_BUILD_DIR}} -DCMAKE_BUILD_TYPE={{.BUILD_CONFIG}} -DNC_BUILD_TESTS={{ .CMAKE_TEST_STATUS }} {{.CLI_ARGS}}
+ - cmd: cmake {{ .CLI_ARGS }}
+ -S .
+ -B{{ .CMAKE_BUILD_DIR }}
+ -DCMAKE_BUILD_TYPE={{ .BUILD_CONFIG }}
+ -DNC_BUILD_TESTS={{ .CMAKE_TEST_STATUS }}
+
- task: compile
- vars: { BUILD_CONFIG: '{{.BUILD_CONFIG}}' }
- - cmd: echo "Build complete. Your files can be found in the {{.CMAKE_BUILD_DIR}} directory"
+ vars: { BUILD_CONFIG: '{{ .BUILD_CONFIG }}' }
+
+ - cmd: echo "Build complete. Your files can be found in the {{ .CMAKE_BUILD_DIR }} directory"
silent: true
+ compile:
+ internal: true
+ cmds:
+ - cmd: cmake
+ --build {{ .CMAKE_BUILD_DIR }}
+ --config {{ .BUILD_CONFIG }}
+
install:
desc: "Uses cmake to install the library on your system"
cmds:
- cmd: echo "Installing noscrypt globally"
silent: true
- - cmd: cmake --install {{.CMAKE_BUILD_DIR}} {{.CLI_ARGS}}
+ - cmd: cmake --install {{ .CMAKE_BUILD_DIR }} {{ .CLI_ARGS }}
#CI ONLY!!
@@ -87,7 +91,7 @@ tasks:
#called by build pipeline to build module
build:
cmds:
- - echo "building project {{.PROJECT_NAME}}"
+ - echo "building project {{ .PROJECT_NAME }}"
- cmd: powershell -Command "mkdir bin/ -Force"
ignore_error: true
@@ -103,48 +107,59 @@ tasks:
cmds:
- for: [ bin/, build/ ]
task: clean-internal
- vars: { FILE: '{{.ITEM}}'}
+ vars: { FILE: '{{ .ITEM }}'}
clean-internal:
internal: true
ignore_error: true
cmds:
- - cmd: rm -rf '{{.FILE}}'
+ - cmd: rm -rf '{{ .FILE }}'
platforms: [linux, darwin]
- - cmd: powershell rm -Recurse -Force '{{.FILE}}'
+ - cmd: powershell rm -Recurse -Force '{{ .FILE }}'
platforms: [windows]
build_win_x64:
internal: true
+ platforms: [ windows ]
vars:
- TARGET_DLL: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/msvc-x64-release-{{.PROJECT_NAME}}.tgz'
- DLL_FILES: '{{.PROJECT_NAME}}.dll {{.PROJECT_NAME}}.lib license.txt'
- TARGET_STATIC: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/msvc-x64-release-{{.PROJECT_NAME}}-static.tgz'
- STATIC_FILES: '{{.PROJECT_NAME}}_static.lib license.txt'
+ TARGET: '{{ .PROJECT_DIR }}/{{ .BINARY_DIR }}/msvc-x64-{{ .CI_BUILD_CONFIG }}-{{ .PROJECT_NAME }}.tgz'
BUILD_DIR: 'build/win-x64'
+
+ TAR_FILES: "
+ {{ .PROJECT_NAME }}.dll
+ {{ .PROJECT_NAME }}.lib
+ {{ .PROJECT_NAME }}_static.lib
+ license.txt"
cmds:
+ #remove deps dir to avoid conflicts with vnbuild
+ - defer: powershell rm -Recurse -Force "{{ .BUILD_DIR }}/_deps"
+
#invoke cmake build
- - cmake -S . -B {{.BUILD_DIR}} -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DNC_BUILD_TESTS=OFF
- - cmake --build {{.BUILD_DIR}} --config Release
+ - cmd: cmake
+ -S .
+ -B {{ .BUILD_DIR }}
+ -G "Visual Studio 17 2022"
+ -A x64
+ -DCMAKE_BUILD_TYPE={{ .CI_BUILD_CONFIG }}
+ -DNC_BUILD_TESTS=OFF
+
+ - cmake --build {{ .BUILD_DIR }} --config {{ .CI_BUILD_CONFIG }}
#copy license to build dir
- - powershell -Command "cp license {{.BUILD_DIR}}/Release/license.txt"
+ - cmd: powershell cp license '{{ .BUILD_DIR }}/Release/license.txt'
#tar up the binaries
- - cd {{.BUILD_DIR}}/Release && tar -czf "{{.TARGET_DLL}}" {{.DLL_FILES}}
-
- #tar up static libs
- - cd {{.BUILD_DIR}}/Release && tar -czf "{{.TARGET_STATIC}}" {{.STATIC_FILES}}
+ - cmd: cd {{ .BUILD_DIR }}/Release && tar -czf "{{ .TARGET }}" {{ .TAR_FILES }}
pack_source:
internal: true
desc: "Packs up the project source code and creates a tarball in the builds binary directory"
vars:
- TARGET_SOURCE: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/{{.PROJECT_NAME}}-src.tgz'
+ TARGET_SOURCE: '{{ .PROJECT_DIR }}/{{ .BINARY_DIR }}/{{ .PROJECT_NAME }}-src.tgz'
SOURCE_FILES:
CMakeLists.txt
Taskfile.yaml
@@ -158,7 +173,7 @@ tasks:
cmds:
#tar up the source
- - tar -czf "{{.TARGET_SOURCE}}" {{ .SOURCE_FILES | join " " }}
+ - tar -czf "{{ .TARGET_SOURCE }}" {{ .SOURCE_FILES | join " " }}
#################################
#
@@ -173,7 +188,7 @@ tasks:
cmds:
- task: compile
vars: { BUILD_CONFIG: 'Debug' }
- - cmd: gdb '{{.CMAKE_BUILD_DIR}}/{{.TEST_EXE_NAME}}'
+ - cmd: gdb '{{ .CMAKE_BUILD_DIR }}/{{ .TEST_EXE_NAME }}'
dev-update-deps:
desc: "Updates vendored projects files (headers mostly) from their source repositories to the latest version"
@@ -191,13 +206,13 @@ tasks:
MC_DIR: 'vendor/monocypher'
TMP_DIR: '.update/mc'
cmds:
- - cmd: powershell mkdir '{{.TMP_DIR}}' -Force
+ - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force
ignore_error: true
- - git clone --branch {{.MC_GIT_BRANCH}} {{.MC_GIT_URL}} '{{.TMP_DIR}}'
+ - git clone --branch {{ .MC_GIT_BRANCH }} {{ .MC_GIT_URL }} '{{ .TMP_DIR }}'
- for: [ 'src/monocypher.h', 'src/monocypher.c' ]
- cmd: powershell cp '{{.TMP_DIR}}/{{.ITEM}}' '{{.MC_DIR}}'
+ cmd: powershell cp '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .MC_DIR }}'
dev-update-mbedtls-headers:
vars:
@@ -206,13 +221,13 @@ tasks:
MBEDTLS_DIR: 'vendor/mbedtls'
TMP_DIR: '.update/mbedtls'
cmds:
- - cmd: powershell mkdir '{{.TMP_DIR}}' -Force
+ - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force
ignore_error: true
- git clone --branch {{ .MBEDTLS_GIT_BRANCH }} {{ .MBEDTLS_GIT_URL }} '{{ .TMP_DIR }}'
- for: [ 'include/mbedtls' ]
- cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.MBEDTLS_DIR}}/include'
+ cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .MBEDTLS_DIR }}/include'
dev-update-openssl-headers:
vars:
@@ -221,13 +236,13 @@ tasks:
OPENSSL_DIR: 'vendor/openssl'
TMP_DIR: '.update/openssl'
cmds:
- - cmd: powershell mkdir '{{.TMP_DIR}}' -Force
+ - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force
ignore_error: true
- git clone --branch {{ .OPENSSL_GIT_BRANCH }} {{ .OPENSSL_GIT_URL }} '{{ .TMP_DIR }}'
- for: [ 'include/openssl' ]
- cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.OPENSSL_DIR}}/include/'
+ cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .OPENSSL_DIR }}/include/'
dev-set-secp256-headers:
vars:
@@ -236,10 +251,10 @@ tasks:
SECP256_DIR: 'vendor/secp256k1'
TMP_DIR: '.update/secp256k1'
cmds:
- - cmd: powershell mkdir '{{.TMP_DIR}}' -Force
+ - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force
ignore_error: true
- git clone --branch {{ .SECP256_GIT_BRANCH }} {{ .SECP256_GIT_URL }} '{{ .TMP_DIR }}'
- for: [ 'include/*' ]
- cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.SECP256_DIR}}/include/secp256k1/' \ No newline at end of file
+ cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .SECP256_DIR }}/include/secp256k1/' \ No newline at end of file