Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
12 changes: 12 additions & 0 deletions .github/workflows/block-needs-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Block needs-review merges

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
pull-requests: read

jobs:
gate:
uses: awslabs/aws-crt-builder/.github/workflows/block-needs-review-label.yml@main
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
41 changes: 41 additions & 0 deletions .github/workflows/check-abi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check ABI compliance

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: check-abi-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
PACKAGE_NAME: aws-c-common
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
AWS_DEFAULT_REGION: us-east-1

permissions:
id-token: write
contents: read
pull-requests: write

jobs:
check-abi:
name: check-abi
runs-on: ubuntu-24.04
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check ABI
uses: awslabs/aws-crt-builder/.github/actions/check-abi@main
with:
lib-name: ${{ env.PACKAGE_NAME }}
builder-version: latest
builder-source: releases
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
workflow_dispatch:
inputs:
dry-run:
description: 'Compute and summarize the bump/version but do not commit, tag, or publish anything.'
required: false
default: 'false'

env:
PACKAGE_NAME: aws-c-common
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
AWS_DEFAULT_REGION: us-east-1

permissions:
id-token: write
contents: write
pull-requests: read

jobs:
release:
name: release
runs-on: ubuntu-24.04
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Release
uses: awslabs/aws-crt-builder/.github/actions/auto-release@main
with:
lib-name: ${{ env.PACKAGE_NAME }}
dry-run: ${{ inputs.dry-run }}
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@
cmake_minimum_required(VERSION 3.9...3.31)
option(ALLOW_CROSS_COMPILED_TESTS "Allow tests to be compiled via cross compile, for use with qemu" OFF)

project(aws-c-common LANGUAGES C VERSION 0.1.0)

message(STATUS "CMake ${CMAKE_VERSION}")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# These modules only define functions/macros, so they're safe to import before
# project(). AwsCheckHeaders, AwsFeatureTests, CTest, and GNUInstallDirs all
# run code at include-time that needs project()'s compiler/languages already
# enabled, so they stay below.
include(AwsGetVersion)
include(AwsCFlags)
include(AwsCheckHeaders)
include(AwsSharedLibSetup)
include(AwsFeatureTests)
include(AwsSanitizers)
include(AwsThreadAffinity)
include(AwsThreadName)

aws_get_version(AWS_C_COMMON_VERSION AWS_C_COMMON_SOVERSION)

project(aws-c-common LANGUAGES C VERSION ${AWS_C_COMMON_VERSION})

message(STATUS "CMake ${CMAKE_VERSION}")

# AwsCheckHeaders calls enable_language(CXX) at include-time when
# PERFORM_HEADER_CHECK is set, which requires project() to have run first.
include(AwsCheckHeaders)
# Runs check_c_source_compiles/check_c_source_runs at include-time, which need
# project()'s C compiler already enabled -- can't move up with the others.
include(AwsFeatureTests)
include(CTest)
include(GNUInstallDirs)

Expand Down Expand Up @@ -226,7 +238,8 @@ if (AWS_PAGE_SIZE)
target_compile_definitions(${PROJECT_NAME} PRIVATE -DAWS_PAGE_SIZE=${AWS_PAGE_SIZE})
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 1.0.0)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${AWS_C_COMMON_VERSION})
# TODO: switch to AWS_C_COMMON_SOVERSION once we reach 1.0.0
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 1)

# libcbor files do includes like: #include "cbor/cbor_export.h"
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.14.4
13 changes: 13 additions & 0 deletions cmake/AwsGetVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Reads VERSION file (format: MAJOR.MINOR.PATCH) and derives:
# var_version_simple - "MAJOR.MINOR.PATCH"
# var_version_soname - "MAJOR.MINOR" (for use as SOVERSION)
function(aws_get_version var_version_simple var_version_soname)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" version_simple)
string(STRIP "${version_simple}" version_simple)
set(${var_version_simple} ${version_simple} PARENT_SCOPE)

string(REPLACE "." ";" version_list ${version_simple})
list(GET version_list 0 version_major)
list(GET version_list 1 version_minor)
set(${var_version_soname} "${version_major}.${version_minor}" PARENT_SCOPE)
endfunction()
Loading