|
| 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 Candidate |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + tags: |
| 23 | + - 'v*-rc*' |
| 24 | + |
| 25 | +jobs: |
| 26 | + build-source-tarball: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout repository |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Extract version from tag |
| 34 | + id: extract_version |
| 35 | + run: | |
| 36 | + TAG_NAME=${GITHUB_REF#refs/tags/} |
| 37 | + echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT |
| 38 | + VERSION=$(echo ${TAG_NAME} | sed 's/^v//' | sed 's/-rc.*$//') |
| 39 | + RC=$(echo ${TAG_NAME} | sed 's/.*-rc//') |
| 40 | + echo "version=${VERSION}" >> $GITHUB_OUTPUT |
| 41 | + echo "rc=${RC}" >> $GITHUB_OUTPUT |
| 42 | + echo "release_id=apache-iceberg-cpp-${VERSION}-rc${RC}" >> $GITHUB_OUTPUT |
| 43 | +
|
| 44 | + - name: Install dependencies |
| 45 | + run: | |
| 46 | + sudo apt-get update |
| 47 | + sudo apt-get install -y cmake build-essential |
| 48 | +
|
| 49 | + - name: Create source tarball |
| 50 | + run: | |
| 51 | + # Create archive with git |
| 52 | + git archive --format=tar.gz --output="${{ steps.extract_version.outputs.release_id }}.tar.gz" --prefix="${{ steps.extract_version.outputs.release_id }}/" HEAD |
| 53 | +
|
| 54 | + # Generate SHA512 checksum |
| 55 | + sha512sum "${{ steps.extract_version.outputs.release_id }}.tar.gz" > "${{ steps.extract_version.outputs.release_id }}.tar.gz.sha512" |
| 56 | +
|
| 57 | + # Verify the tarball can be extracted and built |
| 58 | + tar -xzf "${{ steps.extract_version.outputs.release_id }}.tar.gz" |
| 59 | + cd "${{ steps.extract_version.outputs.release_id }}" |
| 60 | +
|
| 61 | + # Basic build test |
| 62 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 63 | + cmake --build build --parallel $(nproc) |
| 64 | +
|
| 65 | + - name: Run license check |
| 66 | + run: | |
| 67 | + # Extract the tarball if not already extracted |
| 68 | + if [ ! -d "${{ steps.extract_version.outputs.release_id }}" ]; then |
| 69 | + tar -xzf "${{ steps.extract_version.outputs.release_id }}.tar.gz" |
| 70 | + fi |
| 71 | +
|
| 72 | + cd "${{ steps.extract_version.outputs.release_id }}" |
| 73 | + dev/release/run_rat.sh . |
| 74 | +
|
| 75 | + - name: Create GitHub Release |
| 76 | + uses: softprops/action-gh-release@v1 |
| 77 | + with: |
| 78 | + tag_name: ${{ steps.extract_version.outputs.tag_name }} |
| 79 | + name: Apache Iceberg C++ ${{ steps.extract_version.outputs.version }} RC${{ steps.extract_version.outputs.rc }} |
| 80 | + prerelease: true |
| 81 | + draft: false |
| 82 | + files: | |
| 83 | + ${{ steps.extract_version.outputs.release_id }}.tar.gz |
| 84 | + ${{ steps.extract_version.outputs.release_id }}.tar.gz.sha512 |
| 85 | + env: |
| 86 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 87 | + |
| 88 | + - name: Upload artifacts |
| 89 | + uses: actions/upload-artifact@v4 |
| 90 | + with: |
| 91 | + name: release-candidate-${{ steps.extract_version.outputs.version }}-rc${{ steps.extract_version.outputs.rc }} |
| 92 | + path: | |
| 93 | + ${{ steps.extract_version.outputs.release_id }}.tar.gz |
| 94 | + ${{ steps.extract_version.outputs.release_id }}.tar.gz.sha512 |
| 95 | + retention-days: 30 |
0 commit comments