Skip to content

Commit 4346b32

Browse files
committed
Add release workflow and document release process
1 parent 0588fd6 commit 4346b32

3 files changed

Lines changed: 146 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Create a release of HDF5 Cache VOL
2+
3+
# 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
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
- '!v*rc*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
package:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout source
18+
uses: actions/checkout@v3
19+
20+
- name: Extract version number
21+
id: get_version
22+
# Skip leading "v"
23+
run: echo "version=${GITHUB_REF_NAME:1}" >> $GITHUB_OUTPUT
24+
25+
- name: Create Build Environment
26+
run: cmake -E make_directory ${{github.workspace}}/build
27+
28+
- name: Configure CMake
29+
shell: bash
30+
working-directory: ${{github.workspace}}/build
31+
run: |
32+
cmake -D HDF5_VOL_CACHE_PACKAGE_SOURCE=1 $GITHUB_WORKSPACE
33+
make package_source
34+
35+
- name: Create Release
36+
id: create_release
37+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
38+
with:
39+
tag_name: "${{ github.ref }}"
40+
name: "Cache VOL v${{ steps.get_version.outputs.version }}"
41+
draft: true
42+
prerelease: false
43+
files: |
44+
${{github.workspace}}/build/hdf5_vol_cache-${{ steps.get_version.outputs.version }}.tar.gz

CMakeLists.txt

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
77
include(CTest)
88
enable_testing()
99

10-
find_package(MPI REQUIRED)
11-
find_package(ASYNC REQUIRED)
12-
find_package(HDF5 REQUIRED COMPONENTS C)
10+
if (NOT HDF5_VOL_CACHE_PACKAGE_SOURCE)
11+
find_package(MPI REQUIRED)
12+
find_package(ASYNC REQUIRED)
13+
find_package(HDF5 REQUIRED COMPONENTS C)
1314

14-
include_directories(${MPI_INCLUDE_PATH})
15-
include_directories(${HDF5_INCLUDE_DIRS})
16-
include_directories(${ASYNC_INCLUDE_DIRS})
15+
include_directories(${MPI_INCLUDE_PATH})
16+
include_directories(${HDF5_INCLUDE_DIRS})
17+
include_directories(${ASYNC_INCLUDE_DIRS})
18+
endif ()
1719

1820
if(NOT HDF5_VOL_CACHE_INSTALL_BIN_DIR)
1921
set(HDF5_VOL_CACHE_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
@@ -63,4 +65,51 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmarks)
6365
#-----------------------------------------------------------------------------
6466
# Utilities
6567
#-----------------------------------------------------------------------------
66-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils)
68+
if (NOT HDF5_VOL_CACHE_PACKAGE_SOURCE)
69+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils)
70+
endif ()
71+
72+
#-----------------------------------------------------------------------------
73+
# CPack
74+
#-----------------------------------------------------------------------------
75+
set (CPACK_PACKAGE_NAME "${HDF5_VOL_CACHE_PACKAGE_NAME}")
76+
set (CPACK_PACKAGE_DESCRIPTION_FILE ${HDF5_VOL_CACHE_SOURCE_DIR}/README.md)
77+
set (CPACK_RESOURCE_FILE_LICENSE ${HDF5_VOL_CACHE_SOURCE_DIR}/LICENSE)
78+
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${HDF5_VOL_CACHE_PACKAGE_DESCRIPTION}")
79+
set (CPACK_PACKAGE_VENDOR "${HDF5_VOL_CACHE_PACKAGE_VENDOR}")
80+
set (CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
81+
set (CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
82+
set (CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
83+
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${HDF5_VOL_CACHE_PACKAGE}-${PROJECT_VERSION})
84+
set (CPACK_SOURCE_IGNORE_FILES
85+
# Files specific to version control
86+
"/\\\\.git/"
87+
"/\\\\.git$"
88+
"/\\\\.gitattributes$"
89+
"/\\\\.github/"
90+
"/\\\\.gitignore$"
91+
"/\\\\.gitmodules$"
92+
93+
# IDE files
94+
"/\\\\.vscode/"
95+
"/\\\\.settings/"
96+
"/\\\\.autotools$"
97+
"/\\\\.autotools$"
98+
"/\\\\.project$"
99+
"/\\\\.cproject$"
100+
101+
# Misc
102+
"/\\\\.gitlab-ci.yml$"
103+
104+
# Build
105+
"/build/"
106+
107+
# Temporary files
108+
"\\\\.swp$"
109+
"\\\\.#"
110+
"/#"
111+
"~$"
112+
)
113+
114+
include (CPack)
115+

docs/RELEASE_PROCESS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
These are the steps to follow when creating a new release of the HDF5 Cache VOL connector:
2+
3+
0. Ensure all changes are ready for the release and committed to the repository
4+
5+
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
6+
7+
<b>Example:</b>
8+
```CMake
9+
project (HDF5_VOL_CACHE VERSION 1.2.1)
10+
```
11+
12+
becomes
13+
14+
```CMake
15+
project (HDF5_VOL_CACHE VERSION 2.0.0)
16+
```
17+
18+
2. Commit the change to the CMakeLists.txt file, using the version number with a leading "v" as the commit message
19+
20+
<b>Example:</b>
21+
```bash
22+
git add CMakeLists.txt
23+
git commit -m "v2.0.0"
24+
git push
25+
```
26+
27+
3. Create a tag pointing to the commit from the previous step, using a leading "v" for the tag name
28+
29+
<b>Example with signed tag:</b>
30+
```bash
31+
git tag -s v2.0.0 -m "HDF5 Cache VOL 2.0.0"
32+
```
33+
34+
<b>Example with unsigned tag:</b>
35+
```bash
36+
git tag -a v2.0.0 -m "HDF5 Cache VOL 2.0.0"
37+
```
38+
39+
4. Push the tag from the previous step, triggering the release workflow
40+
41+
<b>Example:</b>
42+
```bash
43+
git push origin v2.0.0
44+
```
45+
46+
5. On GitHub, edit the draft release created by the release workflow to tidy up any details, then publish the release when finished

0 commit comments

Comments
 (0)