1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+
18+ name : Release
19+
20+ on :
21+ push :
22+ tags :
23+ # Trigger workflow when a tag whose name matches the pattern
24+ # pattern "apache-arrow-{MAJOR}.{MINOR}.{PATCH}" is pushed.
25+ - " apache-arrow-[0-9]+.[0-9]+.[0-9]+"
26+
27+ permissions :
28+ contents : write
29+
30+ env :
31+ GH_TOKEN : ${{ github.token }}
32+
33+ jobs :
34+ publish :
35+ name : Publish
36+ runs-on : ubuntu-latest
37+ timeout-minutes : 5
38+ steps :
39+ - name : Get Tag Name of Latest Release Candidate
40+ run : |
41+ rc_tag=$(gh release list --repo apache/arrow | \
42+ cut -f3 | \
43+ grep -F "${GITHUB_REF_NAME}-rc" | \
44+ head -n1)
45+ echo "Latest Release Candidate Tag: ${rc_tag}"
46+ echo "RELEASE_CANDIDATE_TAG_NAME=${rc_tag}" >> ${GITHUB_ENV}
47+ - name : Store Version and Release Candidate Number
48+ run : |
49+ version_with_rc=${RELEASE_CANDIDATE_TAG_NAME#apache-arrow-}
50+ version=${version_with_rc%-rc*}
51+ rc_num=${version_with_rc#${version}-rc}
52+ echo "VERSION_WITH_RC=${version_with_rc}" >> ${GITHUB_ENV}
53+ echo "VERSION=${version}" >> ${GITHUB_ENV}
54+ echo "RC_NUM=${rc_num}" >> ${GITHUB_ENV}
55+ - name : Download Release Candidate Artifacts
56+ run : |
57+ mkdir release_candidate_artifacts
58+ gh release download ${RELEASE_CANDIDATE_TAG_NAME} --repo apache/arrow --dir release_candidate_artifacts
59+ - name : Create Release Title
60+ run : |
61+ title="Apache Arrow ${VERSION}"
62+ echo "RELEASE_TITLE=${title}" >> ${GITHUB_ENV}
63+ # Set the release notes to "TODO" temporarily. After the release notes page
64+ # (https://arrow.apache.org/release/{VERSION}.html) is published, use
65+ # gh release edit to update the release notes to refer to the newly
66+ # pushed web page. See dev/post/post-05-update-gh-release-notes.sh
67+ - name : Create GitHub Release
68+ run : |
69+ gh release create ${GITHUB_REF_NAME} \
70+ --repo apache/arrow \
71+ --verify-tag \
72+ --title "${RELEASE_TITLE}" \
73+ --notes "TODO" \
74+ release_candidate_artifacts/*
0 commit comments