Skip to content

Commit 4430659

Browse files
authored
Prepared for v0.1.0~tech_preview release (#42)
1 parent d39cdad commit 4430659

File tree

6 files changed

+38
-11
lines changed

6 files changed

+38
-11
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: release
44

55
on:
66
push:
7-
tags: [ "v[0-9]+*" ]
7+
tags: [ "v*" ]
88
branches:
99
- main
1010

docs/release-notes/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
## 0.1.0
1+
## 0.1.0~tech_preview
22

3-
Initial alpha release.
3+
Initial technical preview release.
4+
5+
This is not an alpha or beta stability commitment.
6+
The distro may not work correctly in all environments and may affect the behavior of the monitored application.

prod/native/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ endforeach()
1818
include(otel_read_properties)
1919
otel_read_properties("../../project.properties" "_PROJECT_PROPERTIES_")
2020

21-
set(_PROJECT_PROPERTIES_VERSION_SHORT ${_PROJECT_PROPERTIES_VERSION})
21+
# Keep only the numeric prefix for project(VERSION ...), e.g. 1.2.3 from 1.2.3~tech_preview.
22+
string(REGEX MATCH "^[0-9]+(\\.[0-9]+)?(\\.[0-9]+)?(\\.[0-9]+)?" _PROJECT_PROPERTIES_VERSION_SHORT "${_PROJECT_PROPERTIES_VERSION}")
23+
24+
if(NOT _PROJECT_PROPERTIES_VERSION_SHORT)
25+
message(FATAL_ERROR "Invalid project version for CMake project(VERSION ...): ${_PROJECT_PROPERTIES_VERSION}")
26+
endif()
2227

2328
if(NOT DEFINED ENV{BUILDING_CONAN_DEPENDENCIES_ONLY})
2429
if(DEFINED ENV{GITHUB_SHA})

project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=0.1.0
1+
version=0.1.0~tech_preview
22
supported_php_versions=(81 82 83 84)
33
supported_package_types=(apk deb rpm)
44
test_all_php_versions_with_package_type=deb

tools/build/build_packages.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ if [[ -z "${PACKAGE_VERSION+x}" ]] || [[ -z "${BUILD_ARCHITECTURE+x}" ]] || [[ -
7171
exit 1
7272
fi
7373

74+
sanitize_package_version_for_type() {
75+
local version="${1:?}"
76+
local pkg_type="${2:?}"
77+
78+
case "${pkg_type}" in
79+
"deb")
80+
# Debian version field does not allow underscore characters.
81+
echo "${version//_/.}"
82+
;;
83+
*)
84+
echo "${version}"
85+
;;
86+
esac
87+
}
88+
7489
test_package() {
7590
local highest_supported_php_version_no_dot=$(get_array_max_value ${_PROJECT_PROPERTIES_SUPPORTED_PHP_VERSIONS})
7691
local PHP_VERSION=$(convert_no_dot_to_dot_separated_version "${highest_supported_php_version_no_dot}")
@@ -162,15 +177,19 @@ fi
162177
echo "Running on platform ${DOCKER_PLATFORM}";
163178

164179
mkdir -p "${PWD}/build/packages"
165-
envsubst <packaging/nfpm.yaml >${PWD}/build/packages/nfpm.yaml
166180

167181
for pkg_type in "${PACKAGE_TYPES[@]}"
168182
do
183+
EFFECTIVE_PACKAGE_VERSION="$(sanitize_package_version_for_type "${PACKAGE_VERSION}" "${pkg_type}")"
184+
169185
echo "Building package type: ${pkg_type}"
186+
echo "Effective package version for ${pkg_type}: ${EFFECTIVE_PACKAGE_VERSION}"
187+
188+
PACKAGE_VERSION="${EFFECTIVE_PACKAGE_VERSION}" envsubst <packaging/nfpm.yaml >${PWD}/build/packages/nfpm.yaml
170189

171190
docker run --rm \
172191
--platform ${DOCKER_PLATFORM} \
173-
-e PACKAGE_VERSION="${PACKAGE_VERSION}" \
192+
-e PACKAGE_VERSION="${EFFECTIVE_PACKAGE_VERSION}" \
174193
-e BUILD_ARCHITECTURE="${BUILD_ARCHITECTURE}" \
175194
-e PACKAGE_GOARCHITECTURE="${PACKAGE_GOARCHITECTURE}" \
176195
-e PACKAGE_SHA="${PACKAGE_SHA}" \

tools/build/get_release_note.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ find_previous_release_tag() {
5858
local release_tag="$1"
5959
local changelog_file="$2"
6060

61-
# Extract version numbers, ignoring the anchor tags
62-
grep -E "^## [0-9]+\.[0-9]+\.[0-9]+" "$changelog_file" | sed 's/^## \([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/' | sort -rV | grep -A 1 "^$release_tag" | tail -n 1
61+
# Extract the first token after "## " as the release version.
62+
grep -E "^## " "$changelog_file" | sed 's/^##[[:space:]]\+\([^[:space:]]\+\).*/\1/' | sort -rV | grep -A 1 "^$release_tag$" | tail -n 1
6363
}
6464

6565
extract_release_notes() {
@@ -70,8 +70,8 @@ extract_release_notes() {
7070
local next_section_found=0
7171

7272
while IFS= read -r line; do
73-
# Check if we've found a new version section with anchor
74-
if [[ "$line" =~ ^##\ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
73+
# Check if we've found a new version section and read version token.
74+
if [[ "$line" =~ ^##[[:space:]]+([^[:space:]]+) ]]; then
7575
current_version="${BASH_REMATCH[1]}"
7676

7777
# If we found our target version

0 commit comments

Comments
 (0)