Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Copyright (c) 2025 ttldtor.
# SPDX-License-Identifier: BSL-1.0

name: release

on:
workflow_dispatch:
inputs:
publish:
description: 'Publish The Release'
default: true
required: true
type: boolean
use_latest_tag:
description: 'Try To Use The Latest Git Tag'
default: false
required: true
type: boolean
push:
tags:
- 'v*.*.*'

permissions:
actions: read
pages: write
id-token: write

jobs:
get_version:
name: Get Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
tag_name: ${{ steps.set_version.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
fetch-tags: 'true'
fetch-depth: '0'
show-progress: 'true'
- id: get_latest_tag
run: |
echo "tag=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT

- id: set_version
run: |
if [[ "${{ !inputs.use_latest_tag && startsWith(github.ref, 'refs/tags/') }}" == "true" ]]
then
echo "version=${{github.ref_name}}" >> $GITHUB_OUTPUT
echo "tag_name=${{github.ref}}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.get_latest_tag.outputs.tag }}" >> $GITHUB_OUTPUT
echo "tag_name=${{ format('refs/tags/{0}', steps.get_latest_tag.outputs.tag) }}" >> $GITHUB_OUTPUT
fi

build_docs_and_upload_and_deploy_gh_pages:
name: "${{ matrix.config.name }}: Build Docs & Upload"
needs: [ get_version ]
strategy:
matrix:
config:
- name: ubuntu-24.04
image: ubuntu-24.04
runs-on: ${{ matrix.config.image }}
steps:
- name: Install Doxygen
run: |
mkdir dox
cd dox
wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz
tar -xf doxygen-1.13.2.linux.bin.tar.gz
cd doxygen-1.13.2
sudo make
sudo make install
doxygen --version
cd ..
cd ..

- uses: actions/checkout@v4
with:
ref: ${{needs.get_version.outputs.tag_name}}

- name: Check 0
run: |
ls

- name: Check
run: |
ls ${{github.workspace}}

- name: Run Doxygen
run: |
cd "${{github.workspace}}/docs"
( cat ./Doxyfile ; echo "PROJECT_NUMBER=${{needs.get_version.outputs.version}}" ) | doxygen -
doxygen ./Doxyfile
cd ..

- name: Pack
run: |
cd "${{github.workspace}}/docs/html"
zip -r ../org_ttldtor_bits-${{needs.get_version.outputs.version}}-docs.zip .

- name: Upload Docs
uses: actions/upload-artifact@v4
with:
name: artifacts-docs
path: |
${{github.workspace}}/docs/*.zip

- name: Upload docs as gh pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{github.workspace}}/docs/html

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

publish_release:
if: ${{ inputs.publish || contains(github.event_name, 'push')}}
runs-on: ubuntu-latest
name: Publish Release
needs: [ get_version, build_docs_and_upload_and_deploy_gh_pages ]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
pattern: artifacts-*
merge-multiple: true
- name: 'Echo download path'
run: echo ${{steps.download.outputs.download-path}}

- name: Display structure of downloaded files
run: ls -R

- uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
files: |
artifacts/*.zip
# artifacts/build-Samples/*.zip
# artifacts/build-Tools/*.zip
# artifacts/build-bundle/*.zip
prerelease: >
${{ contains(needs.get_version.outputs.version, 'alpha')
|| contains(needs.get_version.outputs.version, 'beta')
|| contains(needs.get_version.outputs.version, 'pre')
|| contains(needs.get_version.outputs.version, 'rc') }}
tag_name: ${{ needs.get_version.outputs.tag_name }}
name: ${{ needs.get_version.outputs.version }}
draft: ${{ contains(needs.get_version.outputs.version, 'draft') }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: BSL-1.0

cmake_minimum_required(VERSION 3.16)
project(bits VERSION 0.2.0 LANGUAGES CXX)
project(bits VERSION 0.3.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CXX_EXTENSIONS OFF)
Expand Down
79 changes: 79 additions & 0 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Doxyfile 1.13.2

PROJECT_NAME = "Library for bit manipulation."
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = YES
CREATE_SUBDIRS_LEVEL = 2
FULL_PATH_NAMES = NO
JAVADOC_AUTOBRIEF = YES
TAB_SIZE = 2
TOC_INCLUDE_HEADINGS = 5
BUILTIN_STL_SUPPORT = YES
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
SHOW_USED_FILES = NO
WARN_LOGFILE = doxygen_warns.log
INPUT = ../include \
../README.md
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.idl \
*.ddl \
*.odl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.l \
*.cs \
*.d \
*.php \
*.php4 \
*.php5 \
*.phtml \
*.inc \
*.m \
*.markdown \
*.md \
*.mm \
*.dox \
*.py \
*.pyw \
*.f90 \
*.f95 \
*.f03 \
*.f08 \
*.f18 \
*.f \
*.for \
*.vhd \
*.vhdl \
*.ucf \
*.qsf \
*.ice
RECURSIVE = YES
EXCLUDE_PATTERNS = */isolated/*
USE_MDFILE_AS_MAINPAGE = ../README.md
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
CLANG_ASSISTED_PARSING = YES
HTML_COLORSTYLE_HUE = 30
HTML_COLORSTYLE_SAT = 160
HTML_COLORSTYLE_GAMMA = 141
HTML_DYNAMIC_SECTIONS = YES
DISABLE_INDEX = NO
FULL_SIDEBAR = YES
SHOW_ENUM_VALUES = YES
USE_MATHJAX = YES
COMPACT_LATEX = YES
LATEX_BIB_STYLE = plain
15 changes: 14 additions & 1 deletion include/bits/bits.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
// Copyright (c) 2025 ttldtor.
// SPDX-License-Identifier: BSL-1.0

/**
* @file
* @brief Library for bit manipulation.
* @author ttldtor
*/

#pragma once

#include <concepts>
#include <limits>
#include <type_traits>

/**
* @defgroup bits
* @{
*/

namespace org::ttldtor::bits {

namespace detail {
Expand Down Expand Up @@ -538,4 +549,6 @@ constexpr SourceBitsType resetBits(SourceBitsType sourceBits, BitMaskType bitMas
}
}

} // namespace org::ttldtor::bits
} // namespace org::ttldtor::bits

/** @} */