kou commented on code in PR #41131: URL: https://github.com/apache/arrow/pull/41131#discussion_r1561882592
########## .github/workflows/release.yml: ########## @@ -0,0 +1,107 @@ +# 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: Release + +on: + push: + branches: + - "maint-[0-9]+.[0-9]+.[0-9]+" + - "release-[0-9]+.[0-9]+.[0-9]+" + - "release-[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" + tags: + # Trigger workflow when a tag whose name matches either + # pattern "apache-arrow-{MAJOR}.{MINOR}.{PATCH}" or pattern + # "apache-arrow-{MAJOR}.{MINOR}.{PATCH}-rc{RC_NUM}" is pushed. + - "apache-arrow-[0-9]+.[0-9]+.[0-9]+" + - "apache-arrow-[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" + +permissions: + contents: write + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + publish: Review Comment: How about creating two jobs for release and release candidate instead of putting `if` to each step? ```yaml jobs: publish-candidate: if: | contains(${GITHUB_REF_NAME}, 'rc') ... publish: if: | !contains(${GITHUB_REF_NAME}, 'rc') ... ``` ########## .github/workflows/release.yml: ########## @@ -0,0 +1,107 @@ +# 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: Release + +on: + push: + branches: + - "maint-[0-9]+.[0-9]+.[0-9]+" + - "release-[0-9]+.[0-9]+.[0-9]+" + - "release-[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" Review Comment: Hmm. I think that we don't need run this workflow for branches. We need to run only for tags because this workflow creates a GitHub Release and it's associated with a Git tag. @assignUser What do you think about this? ########## dev/release/post-01-tag.sh: ########## @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# 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. + +set -e +set -o pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 <version> <rc-num>" + exit +fi + +# Create the release tag and trigger the Publish Release workflow. +release_candidate_tag=apache-arrow-${version}-rc${num} +release_tag=apache-arrow-${version} +git tag -a ${release_tag} ${release_candidate_tag}^{} -m "[Release] Apache Arrow Release ${version}" +git push origin ${release_tag} + +# Wait for the Publish Release workflow to finish. +sleep 2s +workflow_id=$(gh run list --repo apache/arrow --workflow "Publish Release" | cut -f7 | head -n1) +gh run watch ${workflow_id} --repo apache/arrow Review Comment: We don't need this because we don't have following tasks that depend on the GitHub Release. (If we remove this, we don't need `gh` for this.) ########## dev/release/post-01-tag.sh: ########## @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# 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. + +set -e +set -o pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 <version> <rc-num>" + exit +fi + +# Create the release tag and trigger the Publish Release workflow. +release_candidate_tag=apache-arrow-${version}-rc${num} +release_tag=apache-arrow-${version} +git tag -a ${release_tag} ${release_candidate_tag}^{} -m "[Release] Apache Arrow Release ${version}" +git push origin ${release_tag} Review Comment: Could you use `apache` remote? We use it for apache/arrow and `origin` for `${your_github_account}/arrow`. ( https://arrow.apache.org/docs/developers/release.html#creating-a-release-candidate also uses `apache` remote to push a tag.) ```suggestion git push apache ${release_tag} ``` -- 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]
