@@ -35,41 +35,52 @@ jobs:
35
35
- name : Update tags
36
36
run : |
37
37
git fetch --tags --force origin
38
+ - name : Store release tag name as environment variable
39
+ run : |
40
+ echo "RELEASE_TAG_NAME=${{github.ref_name}}" >> "$GITHUB_ENV"
41
+ - name : Prepare Version
42
+ # Extract the version string, version with the release-candidate
43
+ # number string, and release-candidate number from the git tag name
44
+ # (i.e. RELEASE_TAG_NAME). Store extracted values as environment
45
+ # variables in GITHUB_ENV for use in subsequent steps.
46
+ run : |
47
+ version_with_rc=${RELEASE_TAG_NAME#apache-arrow-}
48
+ version=${version_with_rc%-rc*}
49
+ rc=${version_with_rc#${version}-rc}
50
+ echo "ARROW_VERSION_WITH_RC=$version_with_rc" >> "$GITHUB_ENV"
51
+ echo "ARROW_VERSION=$version" >> $GITHUB_ENV
52
+ echo "ARROW_RC=$rc" >> $GITHUB_ENV
38
53
- name : Extract crossbow job id
54
+ # Extract the crossbow job ID from the subject associated with the git
55
+ # tag message. Store the extracted ID as an environment variable in
56
+ # GITHUB_ENV for use in subsequent steps.
39
57
run : |
40
- crossbow_job_id=$(git for-each-ref refs/tags/$GIT_TAG_NAME --format='%(contents:subject)')
41
- echo "CROSSBOW_JOB_ID=$crossbow_job_id" >> $GITHUB_ENV
42
- env :
43
- GIT_TAG_NAME : ${{github.ref_name}}
58
+ crossbow_job_id=$(git for-each-ref refs/tags/$RELEASE_TAG_NAME --format='%(contents:subject)')
59
+ echo "CROSSBOW_JOB_ID=$crossbow_job_id" >> "$GITHUB_ENV"
44
60
- name : Setup Archery
45
61
run : |
46
62
python3 -m pip install -e dev/archery[crossbow]
47
63
- name : Download artifacts
64
+ # Download the MLTBX file associated with the crossbow job ID.
65
+ # Store the path to the downloaded file as an environment variable
66
+ # in GITHUB_ENV for use in subsequent steps.
48
67
run : |
49
68
archery crossbow download-artifacts -f matlab -t release-artifacts $CROSSBOW_JOB_ID
69
+ basefilename=$(find release-artifacts/$CROSSBOW_JOB_ID -name '*.mltbx' -type f | xargs basename)
70
+ mltbx_file=release-artifacts/$CROSSBOW_JOB_ID/$basefilename
71
+ echo "ARROW_MLTBX_FILE=$mltbx_file" >> $GITHUB_ENV
50
72
- name : Cut Pre-Release
51
73
run : |
52
- mltbx_file=$(find release-artifacts/$CROSSBOW_JOB_ID -name '*.mltbx' -type f | xargs basename)
53
- mltbx_path=release-artifacts/$CROSSBOW_JOB_ID/$mltbx_file
54
- version_with_rc=${GIT_TAG_NAME#apache-arrow-}
55
- version=${version_with_rc%-rc*}
56
- rc=${version_with_rc#${version}-rc}
57
-
58
- target_branch=release-${version_with_rc}
59
- title="Apache Arrow {version} RC${rc}"
74
+ target_branch=release-$ARROW_VERSION_WITH_RC
75
+ title="Apache Arrow $ARROW_VERSION RC$ARROW_RC"
60
76
repository=${{github.repository}}
61
- release_notes="Release Candidate: ${version} RC${rc}"
62
-
77
+ release_notes="Release Candidate: $ARROW_VERSION RC$ARROW_RC"
63
78
gh release create \
64
- ${GIT_TAG_NAME} \
65
- ${mltbx_path} \
79
+ $RELEASE_TAG_NAME \
80
+ $ARROW_MLTBX_FILE \
66
81
--prerelease \
67
- --target ${target_branch} \
68
- --notes "${release_notes}" \
69
- --title "${title}" \
70
- --repo ${repository}
71
-
72
- env :
73
- GIT_TAG_NAME : ${{github.ref_name}}
74
-
82
+ --target $target_branch \
83
+ --notes "$release_notes" \
84
+ --title "$title" \
85
+ --repo $repository
75
86
0 commit comments