rambleraptor commented on code in PR #53: URL: https://github.com/apache/terraform-provider-iceberg/pull/53#discussion_r3561335420
########## .github/workflows/tf-release.yml: ########## @@ -0,0 +1,171 @@ +# 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. + +# On a release-candidate tag (e.g. v0.7.0-rc1), builds the source tarball and +# convenience binaries and publishes them as a GitHub prerelease. The release +# manager drives the rest from dev/release/release_rc.sh (see docs/releasing.md); +# CI never signs. + +name: Terraform Build Release Candidate + +on: + push: + tags: + # RC tags only; the final vX.Y.Z tag is published by release.sh. + - 'v*-rc*' + +concurrency: + group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + source-release: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Determine version + id: version + env: + TAG: ${{ github.ref_name }} + run: | + # v0.7.0-rc1 -> version=0.7.0, rc=1 + version=${TAG#v} + version=${version%-rc*} + rc=${TAG##*-rc} + echo "version=${version}" >> "$GITHUB_OUTPUT" + echo "rc=${rc}" >> "$GITHUB_OUTPUT" + + - name: Build source tarball + env: + VERSION: ${{ steps.version.outputs.version }} + RC: ${{ steps.version.outputs.rc }} + run: | + # -rc in the filename, but unpacks to a dir without it so the tree + # matches the final release. + dir="apache-iceberg-terraform-${VERSION}" + tar_gz="apache-iceberg-terraform-${VERSION}-rc${RC}.tar.gz" + git archive --format=tar.gz --prefix="${dir}/" -o "${tar_gz}" HEAD + sha512sum "${tar_gz}" > "${tar_gz}.sha512" + + - name: Upload source artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: source-release-candidate + path: apache-iceberg-terraform-*.tar.gz* + if-no-files-found: error + + binary-release: + name: Build provider binaries + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Determine version + id: version + env: + TAG: ${{ github.ref_name }} + run: | + version=${TAG#v} + version=${version%-rc*} + echo "version=${version}" >> "$GITHUB_OUTPUT" + + - name: Install Go + uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 + with: + go-version: '1.25.1' Review Comment: I will take any excuse possible to avoid writing Bash commands 😄 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
