|
| 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 | + run: | |
| 50 | + if [ "${GITHUB_REF_TYPE}" = "tag" ]; then |
| 51 | + version=${GITHUB_REF_NAME%-rc*} |
| 52 | + version=${version#v} |
| 53 | + rc=${GITHUB_REF_NAME#*-rc} |
| 54 | + else |
| 55 | + version=$(jq -r .version package.json) |
| 56 | + rc=$(date +%Y%m%d) |
| 57 | + fi |
| 58 | + echo "version=${version}" >> ${GITHUB_OUTPUT} |
| 59 | + echo "rc=${rc}" >> ${GITHUB_OUTPUT} |
| 60 | +
|
| 61 | + source: |
| 62 | + name: Source |
| 63 | + needs: target |
| 64 | + runs-on: ubuntu-latest |
| 65 | + timeout-minutes: 5 |
| 66 | + env: |
| 67 | + RC: ${{ needs.target.outputs.rc }} |
| 68 | + VERSION: ${{ needs.target.outputs.version }} |
| 69 | + steps: |
| 70 | + - name: Checkout |
| 71 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 72 | + - name: Archive |
| 73 | + run: | |
| 74 | + id="apache-arrow-js-${VERSION}" |
| 75 | + tar_gz="${id}.tar.gz" |
| 76 | + echo "TAR_GZ=${tar_gz}" >> ${GITHUB_ENV} |
| 77 | + git archive HEAD --prefix "${id}/" --output "${tar_gz}" |
| 78 | + sha256sum "${tar_gz}" > "${tar_gz}.sha256" |
| 79 | + sha512sum "${tar_gz}" > "${tar_gz}.sha512" |
| 80 | + - name: Upload |
| 81 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 82 | + with: |
| 83 | + name: release-source |
| 84 | + path: | |
| 85 | + apache-arrow-js-*.tar.gz* |
| 86 | + - name: Audit |
| 87 | + run: | |
| 88 | + dev/release/run_rat.sh "${TAR_GZ}" |
| 89 | +
|
| 90 | + packages: |
| 91 | + name: Packages |
| 92 | + runs-on: ubuntu-latest |
| 93 | + timeout-minutes: 10 |
| 94 | + steps: |
| 95 | + - name: Checkout |
| 96 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 97 | + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 98 | + with: |
| 99 | + cache: yarn |
| 100 | + node-version: 20 |
| 101 | + - name: Install dependencies |
| 102 | + run: | |
| 103 | + yarn install |
| 104 | + - name: Build |
| 105 | + run: | |
| 106 | + yarn gulp build |
| 107 | +
|
| 108 | + shopt -s globstar |
| 109 | + for package_json in targets/**/package.json; do |
| 110 | + if [[ ${package_json} =~ bin/package.json$ ]]; then |
| 111 | + continue |
| 112 | + fi |
| 113 | + npm pack "${PWD}/$(dirname ${package_json})" |
| 114 | + done |
| 115 | + for tgz in *.tgz; do |
| 116 | + sha256sum "${tgz}" > "${tgz}.sha256" |
| 117 | + sha512sum "${tgz}" > "${tgz}.sha512" |
| 118 | + done |
| 119 | + - name: Upload |
| 120 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 121 | + with: |
| 122 | + name: release-packages |
| 123 | + path: | |
| 124 | + apache-arrow-*.tgz* |
| 125 | +
|
| 126 | + verify: |
| 127 | + name: Verify |
| 128 | + needs: |
| 129 | + - packages |
| 130 | + - source |
| 131 | + - target |
| 132 | + runs-on: ubuntu-latest |
| 133 | + timeout-minutes: 45 |
| 134 | + env: |
| 135 | + RC: ${{ needs.target.outputs.rc }} |
| 136 | + VERSION: ${{ needs.target.outputs.version }} |
| 137 | + steps: |
| 138 | + - name: Checkout |
| 139 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 140 | + - name: Download |
| 141 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 142 | + with: |
| 143 | + pattern: release-* |
| 144 | + - name: Verify |
| 145 | + env: |
| 146 | + VERIFY_DEFAULT: 0 |
| 147 | + VERIFY_PACKAGE: 1 |
| 148 | + VERIFY_SOURCE: 1 |
| 149 | + run: | |
| 150 | + mv release-*/* ./ |
| 151 | + dev/release/verify_rc.sh "${VERSION}" "${RC}" |
| 152 | +
|
| 153 | + upload: |
| 154 | + name: Upload |
| 155 | + needs: |
| 156 | + - target |
| 157 | + - verify |
| 158 | + runs-on: ubuntu-latest |
| 159 | + timeout-minutes: 5 |
| 160 | + permissions: |
| 161 | + contents: write |
| 162 | + env: |
| 163 | + RC: ${{ needs.target.outputs.rc }} |
| 164 | + VERSION: ${{ needs.target.outputs.version }} |
| 165 | + steps: |
| 166 | + - name: Download |
| 167 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 168 | + with: |
| 169 | + pattern: release-* |
| 170 | + - name: Upload |
| 171 | + if: github.ref_type == 'tag' |
| 172 | + env: |
| 173 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 174 | + run: | |
| 175 | + gh release create ${GITHUB_REF_NAME} \ |
| 176 | + --generate-notes \ |
| 177 | + --prerelease \ |
| 178 | + --repo ${GITHUB_REPOSITORY} \ |
| 179 | + --title "Apache Arrow JS ${VERSION} RC${RC}" \ |
| 180 | + --verify-tag \ |
| 181 | + release-*/*.tar.gz* \ |
| 182 | + release-*/*.tgz* |
0 commit comments