Skip to content

Commit

Permalink
Add no_rc_no_dev_version as a crossbow property.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Nov 14, 2024
1 parent c9c3622 commit 1af4cea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
14 changes: 14 additions & 0 deletions dev/archery/archery/crossbow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,19 @@ def __init__(self, head, branch, remote, version, r_version, email=None):
self.r_version = r_version
self.no_rc_version = re.sub(r'-rc\d+\Z', '', version)
self.no_rc_r_version = re.sub(r'-rc\d+\Z', '', r_version)
# MAJOR.MINOR.PATCH Versioning
#
# Excludes:
#
# 1. Release Candidate (RC) string components (e.g. -rc123)
# 2. Dev string components (e.g. .dev123)
#
# Example:
#
# '19.0.0.dev66' ->
# '19.0.0'
self.no_rc_no_dev_version = \
re.sub(r'\.dev\d+\Z', '', self.no_rc_version)
# Semantic Versioning 1.0.0: https://semver.org/spec/v1.0.0.html
#
# > A pre-release version number MAY be denoted by appending an
Expand Down Expand Up @@ -1187,6 +1200,7 @@ def from_config(cls, config, target, tasks=None, groups=None, params=None):
versions = {
'version': target.version,
'no_rc_version': target.no_rc_version,
'no_rc_no_dev_version': target.no_rc_no_dev_version,
'no_rc_semver_version': target.no_rc_semver_version,
'no_rc_snapshot_version': target.no_rc_snapshot_version,
'r_version': target.r_version,
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/matlab/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
MATLABPATH: arrow/matlab/tools
ARROW_MATLAB_TOOLBOX_FOLDER: arrow/matlab/install/arrow_matlab
ARROW_MATLAB_TOOLBOX_OUTPUT_FOLDER: artifacts/matlab-dist
ARROW_MATLAB_TOOLBOX_VERSION: {{ arrow.no_rc_version }}
ARROW_MATLAB_TOOLBOX_VERSION: {{ arrow.no_rc_no_dev_version }}
uses: matlab-actions/run-command@v2
with:
command: packageMatlabInterface
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ tasks:
ci: github
template: matlab/github.yml
artifacts:
- matlab-arrow-[0-9]+.[0-9]+.[0-9]+.mltbx
- matlab-arrow-{no_rc_no_dev_version}.mltbx

############################## Arrow JAR's ##################################

Expand Down
16 changes: 7 additions & 9 deletions matlab/tools/packageMatlabInterface.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

toolboxFolder = string(getenv("ARROW_MATLAB_TOOLBOX_FOLDER"));
outputFolder = string(getenv("ARROW_MATLAB_TOOLBOX_OUTPUT_FOLDER"));
toolboxVersionRaw = string(getenv("ARROW_MATLAB_TOOLBOX_VERSION"));
toolboxVersion = string(getenv("ARROW_MATLAB_TOOLBOX_VERSION"));
if isempty(toolboxVersion)
error("ARROW_MATLAB_TOOLBOX_VERSION environment variable value is empty." + ...
"ARROW_MATLAB_TOOLBOX_VERSION should follow the general form: ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.";
end

appendLicenseText(fullfile(toolboxFolder, "LICENSE.txt"));
appendNoticeText(fullfile(toolboxFolder, "NOTICE.txt"));
Expand All @@ -27,13 +31,7 @@

disp("Toolbox Folder: " + toolboxFolder);
disp("Output Folder: " + outputFolder);
disp("Toolbox Version Raw: " + toolboxVersionRaw);

versionPattern = regexpPattern("^[0-9]+\.[0-9]+\.[0-9]+");
toolboxVersion = extract(toolboxVersionRaw, versionPattern);
if isempty(toolboxVersion)
error("Unable to extract MAJOR.MINOR.PATCH version string from " + toolboxVersionRaw);
end
disp("Toolbox Version: " + toolboxVersion);

disp("Toolbox Version:" + toolboxVersion);

Expand Down Expand Up @@ -85,4 +83,4 @@ function appendNoticeText(filename)
"This product includes software from The MathWorks, Inc. (Apache 2.0)"
" * Copyright (C) 2024 The MathWorks, Inc."];
writelines(noticeText, filename, WriteMode="append");
end
end

0 comments on commit 1af4cea

Please sign in to comment.