Skip to content

Commit e137a04

Browse files
raulcdkou
andauthored
GH-47582: [CI][Packaging] Move linux-packaging tasks to apache/arrow repository (#47600)
### Rationale for this change There are several things that make this change wanted. We want to move some CI jobs from `ursacomputing/crossbow` to `apache/arrow`. Moving the Linux Packaging jobs will allow us to automate some release tasks and potentially (if we are able to make reproducible builds for linux packaging work) add automated signing to them avoiding having to require a PMC signature for the Linux packaging artifacts. ### What changes are included in this PR? - Move `check_labels` and `report_ci` jobs to independent reusable workflows. - Update `cpp_extra` to use those. - Create new `linux_packaging.yml` workflow replicating work that was done on crossbow. Integrate that workflow with `check_labels` and `report_ci` - Update release binary submit and binary download to run workflow when tag is pushed and download the artifacts from the release instead of from the crossbow repository. ### Are these changes tested? Some via CI on fork and some manual testing. ### Are there any user-facing changes? No * GitHub Issue: #47582 Lead-authored-by: Raúl Cumplido <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 0d32975 commit e137a04

File tree

16 files changed

+578
-582
lines changed

16 files changed

+578
-582
lines changed

.github/workflows/check_labels.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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: Check Labels Reusable
19+
20+
on:
21+
workflow_call:
22+
inputs:
23+
parent-workflow:
24+
description: "The parent workflow filename (without .yml)"
25+
required: true
26+
type: string
27+
outputs:
28+
ci-extra-labels:
29+
description: "The extra CI labels"
30+
value: ${{ jobs.check-labels.outputs.ci-extra-labels }}
31+
force:
32+
description: "Whether to force running the jobs"
33+
value: ${{ jobs.check-labels.outputs.force }}
34+
35+
jobs:
36+
check-labels:
37+
name: Check labels
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 5
40+
outputs:
41+
ci-extra-labels: ${{ steps.check.outputs.ci-extra-labels }}
42+
force: ${{ steps.check.outputs.force }}
43+
steps:
44+
- name: Checkout Arrow
45+
if: github.event_name == 'pull_request'
46+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47+
- name: Check
48+
id: check
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
run: |
52+
set -ex
53+
case "${GITHUB_EVENT_NAME}" in
54+
push|schedule|workflow_dispatch)
55+
echo "force=true" >> "${GITHUB_OUTPUT}"
56+
;;
57+
pull_request)
58+
{
59+
echo "ci-extra-labels<<LABELS"
60+
gh pr view ${{ github.event.number }} \
61+
--jq '[.labels[].name | select(startswith("CI: Extra"))]' \
62+
--json labels \
63+
--repo ${GITHUB_REPOSITORY}
64+
echo "LABELS"
65+
} >> "${GITHUB_OUTPUT}"
66+
git fetch origin ${GITHUB_BASE_REF}
67+
git diff --stat origin/${GITHUB_BASE_REF}..
68+
if git diff --stat origin/${GITHUB_BASE_REF}.. | \
69+
grep \
70+
--fixed-strings ".github/workflows/${{ inputs.parent-workflow }}.yml" \
71+
--quiet; then
72+
echo "force=true" >> "${GITHUB_OUTPUT}"
73+
fi
74+
;;
75+
esac

.github/workflows/cpp_extra.yml

Lines changed: 18 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ on:
2424
- '!dependabot/**'
2525
paths:
2626
- '.dockerignore'
27+
- '.github/workflows/check_labels.yml'
2728
- '.github/workflows/cpp_extra.yml'
29+
- '.github/workflows/report_ci.yml'
2830
- 'ci/conda_env_*'
2931
- 'ci/docker/**'
3032
- 'ci/scripts/ccache_setup.sh'
@@ -43,7 +45,9 @@ on:
4345
pull_request:
4446
paths:
4547
- '.dockerignore'
48+
- '.github/workflows/check_labels.yml'
4649
- '.github/workflows/cpp_extra.yml'
50+
- '.github/workflows/report_ci.yml'
4751
- 'ci/conda_env_*'
4852
- 'ci/docker/**'
4953
- 'ci/scripts/ccache_setup.sh'
@@ -75,53 +79,19 @@ permissions:
7579

7680
jobs:
7781
check-labels:
78-
name: Check labels
79-
runs-on: ubuntu-latest
80-
timeout-minutes: 5
81-
outputs:
82-
ci-extra: ${{ steps.check.outputs.ci-extra }}
83-
steps:
84-
- name: Checkout Arrow
85-
if: github.event_name == 'pull_request'
86-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
87-
- name: Check
88-
id: check
89-
env:
90-
GH_TOKEN: ${{ github.token }}
91-
run: |
92-
case "${GITHUB_EVENT_NAME}" in
93-
push|schedule)
94-
ci_extra=true
95-
;;
96-
pull_request)
97-
n_ci_extra_labels=$(
98-
gh pr view ${{ github.event.number }} \
99-
--jq '.labels[].name | select(. == "CI: Extra")' \
100-
--json labels \
101-
--repo ${GITHUB_REPOSITORY} | wc -l)
102-
if [ "${n_ci_extra_labels}" -eq 1 ]; then
103-
ci_extra=true
104-
else
105-
git fetch origin ${GITHUB_BASE_REF}
106-
if git diff --stat origin/${GITHUB_BASE_REF}.. | \
107-
grep \
108-
--fixed-strings ".github/workflows/cpp_extra.yml" \
109-
--quiet; then
110-
ci_extra=true
111-
else
112-
ci_extra=false
113-
fi
114-
fi
115-
;;
116-
esac
117-
118-
echo "ci-extra=${ci_extra}" >> "${GITHUB_OUTPUT}"
82+
uses: ./.github/workflows/check_labels.yml
83+
secrets: inherit
84+
with:
85+
parent-workflow: cpp_extra
11986

12087
docker:
12188
needs: check-labels
12289
name: ${{ matrix.title }}
12390
runs-on: ${{ matrix.runs-on }}
124-
if: needs.check-labels.outputs.ci-extra == 'true'
91+
if: >-
92+
needs.check-labels.outputs.force == 'true' ||
93+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
94+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
12595
timeout-minutes: 75
12696
strategy:
12797
fail-fast: false
@@ -198,7 +168,10 @@ jobs:
198168
needs: check-labels
199169
name: JNI macOS
200170
runs-on: macos-14
201-
if: needs.check-labels.outputs.ci-extra == 'true'
171+
if: >-
172+
needs.check-labels.outputs.force == 'true' ||
173+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
174+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
202175
timeout-minutes: 45
203176
env:
204177
MACOSX_DEPLOYMENT_TARGET: "14.0"
@@ -280,58 +253,8 @@ jobs:
280253
../minimal_build.build/arrow-example
281254
282255
report-extra-cpp:
283-
runs-on: ubuntu-latest
284256
needs:
285257
- docker
286258
- jni-macos
287-
# We don't have the job id as part of the context neither the job name.
288-
# The GitHub API exposes numeric id or job name but not the github.job (report-extra-cpp).
289-
# We match github.job to the name so we can pass it via context in order to be ignored on the report.
290-
# The job is still running.
291-
name: ${{ github.job }}
292-
if: github.event_name == 'schedule' && always()
293-
steps:
294-
- name: Checkout Arrow
295-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
296-
with:
297-
fetch-depth: 0
298-
- name: Setup Python
299-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
300-
with:
301-
python-version: 3
302-
- name: Setup Archery
303-
run: python3 -m pip install -e dev/archery[crossbow]
304-
- name: Prepare common options
305-
run: |
306-
if [ "${GITHUB_REPOSITORY}" = "apache/arrow" ]; then
307-
echo "COMMON_OPTIONS=--send" >> "${GITHUB_ENV}"
308-
else
309-
echo "COMMON_OPTIONS=--dry-run" >> "${GITHUB_ENV}"
310-
fi
311-
- name: Send email
312-
env:
313-
GH_TOKEN: ${{ github.token }}
314-
SMTP_PASSWORD: ${{ secrets.ARROW_SMTP_PASSWORD }}
315-
run: |
316-
archery ci report-email \
317-
--ignore ${{ github.job }} \
318-
--recipient-email '[email protected]' \
319-
--repository ${{ github.repository }} \
320-
--sender-email '[email protected]' \
321-
--sender-name Arrow \
322-
--smtp-port 587 \
323-
--smtp-server 'commit-email.info' \
324-
--smtp-user arrow \
325-
${COMMON_OPTIONS} \
326-
${{ github.run_id }}
327-
- name: Send chat message
328-
if: always()
329-
env:
330-
GH_TOKEN: ${{ github.token }}
331-
CHAT_WEBHOOK: ${{ secrets.ARROW_ZULIP_WEBHOOK }}
332-
run: |
333-
archery ci report-chat \
334-
--ignore ${{ github.job }} \
335-
--repository ${{ github.repository }} \
336-
${COMMON_OPTIONS} \
337-
${{ github.run_id }}
259+
uses: ./.github/workflows/report_ci.yml
260+
secrets: inherit

0 commit comments

Comments
 (0)