|
| 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: RC |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - "**" |
| 24 | + - "!dependabot/**" |
| 25 | + tags: |
| 26 | + - "*-rc*" |
| 27 | + pull_request: |
| 28 | + |
| 29 | +concurrency: |
| 30 | + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +permissions: |
| 34 | + contents: read |
| 35 | + |
| 36 | +jobs: |
| 37 | + target: |
| 38 | + name: Target |
| 39 | + runs-on: ubuntu-latest |
| 40 | + timeout-minutes: 5 |
| 41 | + outputs: |
| 42 | + version: ${{ steps.detect.outputs.version }} |
| 43 | + rc: ${{ steps.detect.outputs.rc }} |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 47 | + - name: Detect |
| 48 | + id: detect |
| 49 | + env: |
| 50 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + run: | |
| 52 | + if [ "${GITHUB_REF_TYPE}" = "tag" ]; then |
| 53 | + version=${GITHUB_REF_NAME%-rc*} |
| 54 | + version=${version#v} |
| 55 | + rc=${GITHUB_REF_NAME#*-rc} |
| 56 | + else |
| 57 | + last_release_tag=$(gh release list \ |
| 58 | + --exclude-drafts \ |
| 59 | + --exclude-pre-releases \ |
| 60 | + --jq '.[].tagName' \ |
| 61 | + --json tagName \ |
| 62 | + --limit 1) |
| 63 | + if [ -n "${last_release_tag}" ]; then |
| 64 | + version=${last_release_tag#v} |
| 65 | + else |
| 66 | + version=1.0.0 |
| 67 | + fi |
| 68 | + rc=$(date +%Y%m%d) |
| 69 | + fi |
| 70 | + echo "version=${version}" >> ${GITHUB_OUTPUT} |
| 71 | + echo "rc=${rc}" >> ${GITHUB_OUTPUT} |
| 72 | +
|
| 73 | + source: |
| 74 | + name: Source |
| 75 | + needs: target |
| 76 | + runs-on: ubuntu-latest |
| 77 | + timeout-minutes: 5 |
| 78 | + env: |
| 79 | + RC: ${{ needs.target.outputs.rc }} |
| 80 | + VERSION: ${{ needs.target.outputs.version }} |
| 81 | + steps: |
| 82 | + - name: Checkout |
| 83 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 84 | + - name: Archive |
| 85 | + run: | |
| 86 | + id="apache-arrow-swift-${VERSION}" |
| 87 | + tar_gz="${id}.tar.gz" |
| 88 | + echo "TAR_GZ=${tar_gz}" >> ${GITHUB_ENV} |
| 89 | + git archive HEAD --prefix "${id}/" --output "${tar_gz}" |
| 90 | + sha256sum "${tar_gz}" > "${tar_gz}.sha256" |
| 91 | + sha512sum "${tar_gz}" > "${tar_gz}.sha512" |
| 92 | + - name: Upload |
| 93 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 94 | + with: |
| 95 | + name: release-source |
| 96 | + path: | |
| 97 | + apache-arrow-swift-*.tar.gz* |
| 98 | + - name: Audit |
| 99 | + run: | |
| 100 | + dev/release/run_rat.sh "${TAR_GZ}" |
| 101 | +
|
| 102 | + verify: |
| 103 | + name: Verify |
| 104 | + needs: |
| 105 | + - source |
| 106 | + - target |
| 107 | + runs-on: ubuntu-latest |
| 108 | + timeout-minutes: 45 |
| 109 | + env: |
| 110 | + RC: ${{ needs.target.outputs.rc }} |
| 111 | + VERSION: ${{ needs.target.outputs.version }} |
| 112 | + steps: |
| 113 | + - name: Checkout |
| 114 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 115 | + - name: Setup Swift |
| 116 | + uses: swift-actions/setup-swift@682457186b71c25a884c45c06f859febbe259240 # v2.3.0 |
| 117 | + with: |
| 118 | + swift-version: "5.10" |
| 119 | + - name: Download |
| 120 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 121 | + with: |
| 122 | + pattern: release-* |
| 123 | + - name: Verify |
| 124 | + env: |
| 125 | + VERIFY_DEFAULT: 0 |
| 126 | + VERIFY_SOURCE: 1 |
| 127 | + run: | |
| 128 | + mv release-*/* ./ |
| 129 | + dev/release/verify_rc.sh "${VERSION}" "${RC}" |
| 130 | +
|
| 131 | + upload: |
| 132 | + name: Upload |
| 133 | + needs: |
| 134 | + - target |
| 135 | + - verify |
| 136 | + runs-on: ubuntu-latest |
| 137 | + timeout-minutes: 5 |
| 138 | + permissions: |
| 139 | + contents: write |
| 140 | + env: |
| 141 | + RC: ${{ needs.target.outputs.rc }} |
| 142 | + VERSION: ${{ needs.target.outputs.version }} |
| 143 | + steps: |
| 144 | + - name: Download |
| 145 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 146 | + with: |
| 147 | + pattern: release-* |
| 148 | + - name: Upload |
| 149 | + if: github.ref_type == 'tag' |
| 150 | + env: |
| 151 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 152 | + run: | |
| 153 | + gh release create ${GITHUB_REF_NAME} \ |
| 154 | + --generate-notes \ |
| 155 | + --prerelease \ |
| 156 | + --repo ${GITHUB_REPOSITORY} \ |
| 157 | + --title "Apache Arrow Swift ${VERSION} RC${RC}" \ |
| 158 | + --verify-tag \ |
| 159 | + release-*/*.tar.gz* |
0 commit comments