Skip to content

Commit 2fb2d55

Browse files
committed
1. Comment package.yml steps
2. Fix syntax errors
1 parent 6c6bb92 commit 2fb2d55

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

.github/workflows/package.yml

+35-24
Original file line numberDiff line numberDiff line change
@@ -35,41 +35,52 @@ jobs:
3535
- name: Update tags
3636
run: |
3737
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
3853
- 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.
3957
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"
4460
- name: Setup Archery
4561
run: |
4662
python3 -m pip install -e dev/archery[crossbow]
4763
- 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.
4867
run: |
4968
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
5072
- name: Cut Pre-Release
5173
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"
6076
repository=${{github.repository}}
61-
release_notes="Release Candidate: ${version} RC${rc}"
62-
77+
release_notes="Release Candidate: $ARROW_VERSION RC$ARROW_RC"
6378
gh release create \
64-
${GIT_TAG_NAME} \
65-
${mltbx_path} \
79+
$RELEASE_TAG_NAME \
80+
$ARROW_MLTBX_FILE \
6681
--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
7586

0 commit comments

Comments
 (0)