3333 - ' format/Flight.proto'
3434 - ' testing'
3535 tags :
36- - ' ** '
36+ - " apache-arrow-*-rc* "
3737 pull_request :
3838 paths :
3939 - ' .dockerignore'
5252 - synchronize
5353 schedule :
5454 - cron : " 0 2 * * *"
55- workflow_dispatch :
56- inputs :
57- version :
58- description : " The Arrow version"
59- type : string
60- required : true
61- no_rc_version :
62- description : " The Arrow version without RC"
63- type : string
64- required : true
6555
6656concurrency :
6757 group : ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
6858 cancel-in-progress : true
6959
7060permissions :
71- contents : read
61+ # Upload to GitHub Release
62+ contents : write
7263
7364jobs :
7465 check-labels :
@@ -113,14 +104,20 @@ jobs:
113104 - ubuntu-noble-arm64
114105 env :
115106 DOCKER_VOLUME_PREFIX : " .docker/"
116- ARROW_VERSION : ${{ inputs.version || ''}}
117- NO_RC_VERSION : ${{ inputs.no_rc_version || ''}}
118107 steps :
108+ - name : Checkout Arrow
109+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
110+ with :
111+ fetch-depth : 0
112+ submodules : recursive
119113 - name : Prepare environment variables
120114 env :
121115 ID : ${{ matrix.id }}
122116 run : |
123- set -ex
117+ set -x
118+ # Example: almalinux-8-amd64 -> almalinux
119+ distribution="${ID%-*-*}"
120+ echo "DISTRIBUTION=${distribution}" >> "${GITHUB_ENV}"
124121 # Example: almalinux-8-amd64 -> amd64
125122 architecture="${ID##*-}"
126123 echo "ARCHITECTURE=${architecture}" >> "${GITHUB_ENV}"
@@ -129,40 +126,33 @@ jobs:
129126 case "${target}" in
130127 almalinux-*|amazon-linux-*|centos-*)
131128 echo "TASK_NAMESPACE=yum" >> "${GITHUB_ENV}"
132- echo "UPLOAD_EXTENSIONS=rpm" >> "${GITHUB_ENV}"
133- if [[ "${architecture}" == "arm64" ]]; then
129+ if [ "${architecture}" = "arm64" ]; then
134130 # Example: almalinux-8 -> almalinux-8-aarch64
135131 target="${target}-aarch64"
136132 fi
137133 echo "YUM_TARGETS=${target}" >> "${GITHUB_ENV}"
138134 ;;
139135 *)
140136 echo "TASK_NAMESPACE=apt" >> "${GITHUB_ENV}"
141- upload_extensions=(ddeb deb debian.tar.xz .dsc .orig.tar.gz)
142- echo "UPLOAD_EXTENSIONS=${upload_extensions[*]}" >> "${GITHUB_ENV}"
143- if [[ "${architecture}" == "arm64" ]]; then
137+ if [ "${architecture}" = "arm64" ]; then
144138 # Example: ubuntu-noble -> ubuntu-noble-arm64
145139 target="${target}-arm64"
146140 fi
147141 echo "APT_TARGETS=${target}" >> "${GITHUB_ENV}"
148142 ;;
149143 esac
150144 echo "TARGET=${target}" >> "${GITHUB_ENV}"
151- - name : Checkout Arrow
152- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
153- with :
154- fetch-depth : 0
155- submodules : recursive
156- - name : Free up disk space
157- if : runner.os == 'Linux' && runner.arch == 'X64'
158- shell : bash
159- run : |
160- ci/scripts/util_free_space.sh
145+
146+ if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
147+ # Example: apache-arrow-21.0.0-rc0 -> 21.0.0-rc0
148+ version="${GITHUB_REF_NAME#apache-arrow-}"
149+ echo "ARROW_VERSION=${version}" >> "${GITHUB_ENV}"
150+ fi
161151 - name : Cache Docker Volumes
162152 uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
163153 with :
164154 path : .docker
165- key : package-linux-${{ matrix.id }}-${{ hashFiles('cpp/**') }}
155+ key : package-linux-${{ matrix.id }}-${{ hashFiles('cpp/**', 'c_glib/**' ) }}
166156 restore-keys : package-linux-${{ matrix.id }}-
167157 - name : Set up Ruby
168158 run : |
@@ -172,91 +162,106 @@ jobs:
172162 ruby \
173163 ruby-dev
174164 - name : Prepare apache-arrow-apt-source for arm64
175- if : ${{ env.ARCHITECTURE == 'arm64' }}
165+ if : env.ARCHITECTURE == 'arm64'
176166 run : |
177167 pushd dev/tasks/linux-packages/apache-arrow-apt-source/apt
178168 for target in *-*; do
179169 cp -a ${target} ${target}-arm64
180170 done
181171 popd
182172 - name : Prepare apache-arrow-release for arm64
183- if : ${{ env.ARCHITECTURE == 'arm64' }}
173+ if : env.ARCHITECTURE == 'arm64'
184174 run : |
185175 pushd dev/tasks/linux-packages/apache-arrow-release/yum
186176 for target in *-*; do
187177 cp -a ${target} ${target}-aarch64
188178 done
189179 popd
190- - name : Get Arrow Version
191- id : get-arrow-version
192- run : |
193- # In case of dev (no workflow_dispatch inputs) compute ARROW_VERSION and
194- # use the same version for NO_RC_VERSION.
195- if [ -z "${ARROW_VERSION}" ]; then
196- ARROW_VERSION=$(git describe --tags --abbrev=0 --match "apache-arrow-[0-9]*.*" | sed 's/^apache-arrow-//')
197- ARROW_VERSION="${ARROW_VERSION}$(date +%Y%m%d)"
198- echo "ARROW_VERSION=${ARROW_VERSION}" >> $GITHUB_ENV
199- echo "NO_RC_VERSION=${ARROW_VERSION}" >> $GITHUB_ENV
200- fi
201- - name : Build
180+ - name : Update version
181+ if : github.ref_type != 'tag'
202182 run : |
203- set -e
204183 pushd dev/tasks/linux-packages
205- rake version:update ARROW_RELEASE_TIME="$(date --iso-8601=seconds)"
206- rake docker:pull || :
207- rake --trace ${TASK_NAMESPACE}:build BUILD_DIR=build
184+ rake version:update
208185 popd
209- env :
210- REPO : ghcr.io/${{ github.repository }}-package-linux
211- - name : Login to Dockerhub
212- if : >-
213- success() &&
214- github.event_name == 'push' &&
215- github.repository == 'apache/arrow' &&
216- github.ref_name == 'main'
186+ - name : Login to GitHub Container registry
217187 uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
218188 with :
219189 registry : ghcr.io
220190 username : ${{ github.actor }}
221- password : ${{ secrets.GITHUB_TOKEN}}
191+ password : ${{ secrets.GITHUB_TOKEN }}
192+ - name : Wait for creating GitHub Release
193+ if : github.ref_type == 'tag'
194+ run : |
195+ dev/release/utils-watch-gh-workflow.sh \
196+ ${GITHUB_REF_NAME} \
197+ release_candidate.yml
198+ - name : Build
199+ run : |
200+ pushd dev/tasks/linux-packages
201+ rake docker:pull || :
202+ rake --trace ${TASK_NAMESPACE}:build BUILD_DIR=build
203+ popd
222204 - name : Docker Push
223205 continue-on-error : true
224206 if : >-
225207 success() &&
226208 github.event_name == 'push' &&
227- github.repository == 'apache/arrow' &&
228209 github.ref_name == 'main'
229- shell : bash
230210 run : |
231211 pushd dev/tasks/linux-packages
232212 rake docker:push
233213 popd
234- env :
235- REPO : ${{ secrets.REPO }}
236214 - name : Build artifact tarball
237- shell : bash
238215 run : |
239- set -ex
240- pushd dev/tasks/linux-packages
241- tar cvzf ${{ matrix.id }}.tar.gz */${TASK_NAMESPACE}/repositories
242- popd
216+ mkdir -p "${DISTRIBUTION}"
217+ cp -a \
218+ dev/tasks/linux-packages/*/${TASK_NAMESPACE}/repositories/${DISTRIBUTION}/* \
219+ "${DISTRIBUTION}/"
220+ # We use latest .deb/.rpm of
221+ # apache-arrow-apt-source/apache-arrow-release built for
222+ # amd64 because they are architecture independent.
223+ if [ "${ARCHITECTURE}" = "amd64" ]; then
224+ if [ "${APT_TASK_NAMESPACE}" = "apt" ]; then
225+ # Example: debian-bookworm-amd64 -> debian-bookworm
226+ code_name="${ID%-*}"
227+ # Example: debian-bookworm -> bookworm
228+ code_name="${code_name#*-}"
229+ # Create
230+ # https://packages.apache.org/artifactory/arrow/${DISTRIBUTION}/apache-arrow-apt-source-latest-${code_name}.deb
231+ # for easy to install.
232+ cp -a \
233+ "${DISTRIBUTION}/pool/${code_name}/a/apache-arrow-apt-source/*.deb \
234+ "${DISTRIBUTION}/apache-arrow-apt-source-latest-${code_name}.deb"
235+ else
236+ # Example: amazon-linux-2023-amd64 -> amazon-linux-2023
237+ version="${ID%-*}"
238+ # Example: amazon-linux-2023 -> 2023
239+ version="${version##*-}"
240+ # Create
241+ # https://packages.apache.org/artifactory/arrow/${DISTRIBUTION}/${version}/apache-arrow-release-latest.rpm
242+ # for easy to install.
243+ cp -a \
244+ "${DISTRIBUTION}/${version}/x86_64/Packages/apache-arrow-release-*.rpm \
245+ "${DISTRIBUTION}/${version}/apache-arrow-release-latest.rpm"
246+ fi
247+ fi
248+ tar cvzf ${{ matrix.id }}.tar.gz ${DISTRIBUTION}
249+ dev/release/utils-generate-checksum.sh ${{ matrix.id }}.tar.gz
243250 - name : Upload the artifacts to the job
244251 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
245252 with :
246253 name : ${{ matrix.id }}
247- path : dev/tasks/linux-packages/${{ matrix.id }}.tar.gz
248- - name : Download Artifacts
249- uses : actions/download-artifact@v4
250- with :
251- path : artifacts-downloaded
252- name : ${{ matrix.id }}
254+ path : ${{ matrix.id }}.tar.gz*
255+ - name : Upload the artifacts to GitHub Release
256+ if : github.ref_type == 'tag'
257+ env :
258+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
259+ run : |
260+ gh release upload ${GITHUB_REF_NAME} \
261+ --clobber \
262+ ${{ matrix.id }}.tar.gz*
253263 - name : Set up test
254264 run : |
255- mv artifacts-downloaded/* dev/tasks/linux-packages
256- pushd dev/tasks/linux-packages
257- rm -rf */${TASK_NAMESPACE}/repositories # Remove artifacts
258- tar xf ${{ matrix.id }}.tar.gz # Use uploaded artifacts
259- popd
260265 sudo apt install -y \
261266 apt-utils \
262267 cpio \
@@ -266,27 +271,25 @@ jobs:
266271 rpm \
267272 rsync
268273 gem install --user-install apt-dists-merge
269- (echo "Key-Type: RSA"; \
270- echo "Key-Length: 4096"; \
271- echo "Name-Real: Test"; \
272- echo "Name-Email: [email protected] "; \ 273- echo "%no-protection") | \
274- gpg --full-generate-key --batch
274+ {
275+ echo "Key-Type: RSA"
276+ echo "Key-Length: 4096"
277+ echo "Name-Real: Test"
278+ echo "Name-Email: [email protected] " 279+ echo "%no-protection"
280+ } | gpg --full-generate-key --batch
275281 GPG_KEY_ID=$(gpg --list-keys --with-colon [email protected] | grep fpr | cut -d: -f10) 276282 echo "GPG_KEY_ID=${GPG_KEY_ID}" >> ${GITHUB_ENV}
277- case "${{ matrix.id }}" in
278- almalinux-*|amazon-linux-*|centos-*)
279- repositories_dir=dev/tasks/linux-packages/apache-arrow-release/yum/repositories
280- rpm2cpio ${repositories_dir}/*/*/*/Packages/apache-arrow-release-*.rpm | \
281- cpio -id
282- mv etc/pki/rpm-gpg/RPM-GPG-KEY-Apache-Arrow \
283- dev/tasks/linux-packages/KEYS
284- ;;
285- esac
283+ if [ "${TASK_NAMESPACE}" = "yum" ]; then
284+ repositories_dir=dev/tasks/linux-packages/apache-arrow-release/yum/repositories
285+ rpm2cpio ${repositories_dir}/*/*/*/Packages/apache-arrow-release-*.rpm |
286+ cpio -id
287+ mv etc/pki/rpm-gpg/RPM-GPG-KEY-Apache-Arrow \
288+ dev/tasks/linux-packages/KEYS
289+ fi
286290 gpg --export --armor [email protected] >> dev/tasks/linux-packages/KEYS 287291 - name : Test
288292 run : |
289- set -e
290293 pushd dev/tasks/linux-packages
291294 rake --trace ${TASK_NAMESPACE}:test
292295 popd
0 commit comments