diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..49b32c1
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,44 @@
+name: Create a release of HDF5 Cache VOL
+
+# Trigger when release tags of style "vX.X.X" are pushed, but not when pre-release tags of style "vX.X.X(-)rc" are pushed
+on:
+ push:
+ tags:
+ - 'v*'
+ - '!v*rc*'
+
+permissions:
+ contents: write
+
+jobs:
+ package:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v3
+
+ - name: Extract version number
+ id: get_version
+ # Skip leading "v"
+ run: echo "version=${GITHUB_REF_NAME:1}" >> $GITHUB_OUTPUT
+
+ - name: Create Build Environment
+ run: cmake -E make_directory ${{github.workspace}}/build
+
+ - name: Configure CMake
+ shell: bash
+ working-directory: ${{github.workspace}}/build
+ run: |
+ cmake -D HDF5_VOL_CACHE_PACKAGE_SOURCE=1 $GITHUB_WORKSPACE
+ make package_source
+
+ - name: Create Release
+ id: create_release
+ uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
+ with:
+ tag_name: "${{ github.ref }}"
+ name: "Cache VOL v${{ steps.get_version.outputs.version }}"
+ draft: true
+ prerelease: false
+ files: |
+ ${{github.workspace}}/build/hdf5_vol_cache-${{ steps.get_version.outputs.version }}.tar.gz
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d2e9ad..55b23f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,13 +7,15 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(CTest)
enable_testing()
-find_package(MPI REQUIRED)
-find_package(ASYNC REQUIRED)
-find_package(HDF5 REQUIRED COMPONENTS C)
+if (NOT HDF5_VOL_CACHE_PACKAGE_SOURCE)
+ find_package(MPI REQUIRED)
+ find_package(ASYNC REQUIRED)
+ find_package(HDF5 REQUIRED COMPONENTS C)
-include_directories(${MPI_INCLUDE_PATH})
-include_directories(${HDF5_INCLUDE_DIRS})
-include_directories(${ASYNC_INCLUDE_DIRS})
+ include_directories(${MPI_INCLUDE_PATH})
+ include_directories(${HDF5_INCLUDE_DIRS})
+ include_directories(${ASYNC_INCLUDE_DIRS})
+endif ()
if(NOT HDF5_VOL_CACHE_INSTALL_BIN_DIR)
set(HDF5_VOL_CACHE_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
@@ -63,4 +65,51 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmarks)
#-----------------------------------------------------------------------------
# Utilities
#-----------------------------------------------------------------------------
-add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils)
+if (NOT HDF5_VOL_CACHE_PACKAGE_SOURCE)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils)
+endif ()
+
+#-----------------------------------------------------------------------------
+# CPack
+#-----------------------------------------------------------------------------
+set (CPACK_PACKAGE_NAME "${HDF5_VOL_CACHE_PACKAGE_NAME}")
+set (CPACK_PACKAGE_DESCRIPTION_FILE ${HDF5_VOL_CACHE_SOURCE_DIR}/README.md)
+set (CPACK_RESOURCE_FILE_LICENSE ${HDF5_VOL_CACHE_SOURCE_DIR}/LICENSE)
+set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${HDF5_VOL_CACHE_PACKAGE_DESCRIPTION}")
+set (CPACK_PACKAGE_VENDOR "${HDF5_VOL_CACHE_PACKAGE_VENDOR}")
+set (CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
+set (CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
+set (CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
+set (CPACK_SOURCE_PACKAGE_FILE_NAME ${HDF5_VOL_CACHE_PACKAGE}-${PROJECT_VERSION})
+set (CPACK_SOURCE_IGNORE_FILES
+ # Files specific to version control
+ "/\\\\.git/"
+ "/\\\\.git$"
+ "/\\\\.gitattributes$"
+ "/\\\\.github/"
+ "/\\\\.gitignore$"
+ "/\\\\.gitmodules$"
+
+ # IDE files
+ "/\\\\.vscode/"
+ "/\\\\.settings/"
+ "/\\\\.autotools$"
+ "/\\\\.autotools$"
+ "/\\\\.project$"
+ "/\\\\.cproject$"
+
+ # Misc
+ "/\\\\.gitlab-ci.yml$"
+
+ # Build
+ "/build/"
+
+ # Temporary files
+ "\\\\.swp$"
+ "\\\\.#"
+ "/#"
+ "~$"
+)
+
+include (CPack)
+
diff --git a/docs/RELEASE_PROCESS.md b/docs/RELEASE_PROCESS.md
new file mode 100644
index 0000000..76c1829
--- /dev/null
+++ b/docs/RELEASE_PROCESS.md
@@ -0,0 +1,46 @@
+These are the steps to follow when creating a new release of the HDF5 Cache VOL connector:
+
+0. Ensure all changes are ready for the release and committed to the repository
+
+1. Update the `VERSION` number specified for the `project ()` command in CMakeLists.txt in the root of the source tree with the new version number
+
+ Example:
+ ```CMake
+ project (HDF5_VOL_CACHE VERSION 1.2.1)
+ ```
+
+ becomes
+
+ ```CMake
+ project (HDF5_VOL_CACHE VERSION 2.0.0)
+ ```
+
+2. Commit the change to the CMakeLists.txt file, using the version number with a leading "v" as the commit message
+
+ Example:
+ ```bash
+ git add CMakeLists.txt
+ git commit -m "v2.0.0"
+ git push
+ ```
+
+3. Create a tag pointing to the commit from the previous step, using a leading "v" for the tag name
+
+ Example with signed tag:
+ ```bash
+ git tag -s v2.0.0 -m "HDF5 Cache VOL 2.0.0"
+ ```
+
+ Example with unsigned tag:
+ ```bash
+ git tag -a v2.0.0 -m "HDF5 Cache VOL 2.0.0"
+ ```
+
+4. Push the tag from the previous step, triggering the release workflow
+
+ Example:
+ ```bash
+ git push origin v2.0.0
+ ```
+
+5. On GitHub, edit the draft release created by the release workflow to tidy up any details, then publish the release when finished