diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000000000..72766d486392d --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: Package + +on: + push: + tags: + # A release candidate should be published whenever a tag with + # the name below is pushed to the apache/arrow repository. + - "apache-arrow-*-rc*" + +jobs: + publish-release-candidate: + name: Publish Release Candidate to GitHub Releases + runs-on: ubuntu-latest + if: github.ref_type == 'tag' + steps: + - name: Checkout apache/arrow + uses: actions/checkout@v4 + with: + path: arrow + fetch-depth: 0 + - name: Checkout ursacomputing/crossbow + uses: actions/checkout@v4 + with: + repository: ursacomputing/crossbow + path: crossbow + fetch-depth: 0 + - name: Store Release Tag Name as Environment Variable + # For convenience, store the release tag name as an environment + # variable for use in subsequent steps. + run: | + echo "ARROW_RELEASE_TAG_NAME=${{github.ref_name}}" >> "$GITHUB_ENV" + - name: Store Version and Release Candidate Number as Environment Variables + # From environment variable ARROW_RELEASE_TAG_NAME, extract the version and + # release candidate number. Store these values as environment variables. + run: | + version_with_rc=${ARROW_RELEASE_TAG_NAME#apache-arrow-} + version=${version_with_rc%-rc*} + rc_num=${version_with_rc#${version}-rc} + echo "ARROW_VERSION_WITH_RC=${version_with_rc}" >> "${GITHUB_ENV}" + echo "ARROW_VERSION=${version}" >> ${GITHUB_ENV} + echo "ARROW_RC_NUM=${rc_num}" >> ${GITHUB_ENV} + - name: Install Archery + run: | + python3 -m pip install -e arrow/dev/archery[crossbow] + - name: Download Release Candidate MLTBX + # Download the MLTBX file from the crossbow GitHub Release's area. + run: | + ./arrow/dev/release/04-binary-download.sh ${ARROW_VERSION} ${ARROW_RC_NUM} --task-filter matlab + mltbx_file=$(find arrow/packages -name '*.mltbx' -type f) + echo "ARROW_MLTBX_FILE=${mltbx_file}" >> $GITHUB_ENV + - name: Create GitHub Release for Release Candidate + # Create a pre-release in apache/arrow's GitHub Releases area. + # Attach the release candidate MLTBX file as an asset. + run: | + target_branch=release-${ARROW_VERSION_WITH_RC} + title="Apache Arrow ${ARROW_VERSION} RC${ARROW_RC_NUM}" + repository=${{github.repository}} + release_notes="Release Candidate: ${ARROW_VERSION} RC${ARROW_RC_NUM}" + gh release create \ + ${ARROW_RELEASE_TAG_NAME} \ + ${ARROW_MLTBX_FILE} \ + --prerelease \ + --target ${target_branch} \ + --notes "${release_notes}" \ + --title "${title}" \ + --repo ${repository} + env: + GH_TOKEN: ${{ github.token }} diff --git a/dev/release/05-binary-upload.sh b/dev/release/05-binary-upload.sh index ae240c02ddf62..b43812f299fe9 100755 --- a/dev/release/05-binary-upload.sh +++ b/dev/release/05-binary-upload.sh @@ -72,6 +72,7 @@ fi : ${UPLOAD_CENTOS:=${UPLOAD_DEFAULT}} : ${UPLOAD_DEBIAN:=${UPLOAD_DEFAULT}} : ${UPLOAD_DOCS:=${UPLOAD_DEFAULT}} +: ${UPLOAD_MATLAB:=${UPLOAD_DEFAULT}} : ${UPLOAD_NUGET:=${UPLOAD_DEFAULT}} : ${UPLOAD_PYTHON:=${UPLOAD_DEFAULT}} : ${UPLOAD_R:=${UPLOAD_DEFAULT}} @@ -135,3 +136,18 @@ docker_run \ VERBOSE=${VERBOSE:-no} \ VERSION=${version} \ YUM_TARGETS=$(IFS=,; echo "${yum_targets[*]}") + +# Create a git tag to associate with a GitHub Release that will +# have the release candidate MLTBX file as an asset. +# +# Push this tag (e.g. apache-arrow-15.0.2-rc0) to the remote +# apache/arrow repository to trigger the GitHub Actions Workflow +# that creates the GitHub Release and uploads the MLTBX file. +# +# See .github/workflows/package.yml for details. +if [ ${UPLOAD_MATLAB} -gt 0 ]; then + release_tag="apache-arrow-${version_with_rc}" + tag_message="Release candidate: ${version_with_rc}" + git tag -a ${release_tag} -m ${tag_message} + git push apache ${release_tag} +fi diff --git a/docs/source/developers/release.rst b/docs/source/developers/release.rst index e7431ce0fb7b9..30fe290cfe853 100644 --- a/docs/source/developers/release.rst +++ b/docs/source/developers/release.rst @@ -228,6 +228,11 @@ Build source and binaries and submit them # Start verifications for binaries and wheels dev/release/07-binary-verify.sh + # Sign and upload MATLAB artifacts to the GitHub Releases area. + # + # NOTE: You must have GitHub CLI installed to run this script. + dev/release/08-matlab-upload.sh + Verify the Release ------------------