You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/07 13:54:15 UTC

[GitHub] [arrow] assignUser commented on a diff in pull request #13328: ARROW-16553: [CI][Java] Adding Java nightly packages (.pom/.jar) to nightlies.apache repository

assignUser commented on code in PR #13328:
URL: https://github.com/apache/arrow/pull/13328#discussion_r891261268


##########
.github/workflows/java_nightly.yml:
##########
@@ -0,0 +1,188 @@
+# 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: Upload Java Nightly builds
+
+on:
+  workflow_dispatch:
+    inputs:
+      prefix:
+        description: Job prefix to use.
+        required: false
+        default: ''
+      dependency_to_install:
+        description: In case need to upload custom artifact to nightly repository (i.e memory / flight / others).
+        required: false
+        default: 'arrow'
+  schedule:
+    - cron: '0 14 * * *'
+jobs:
+  upload:
+    env:
+      PREFIX: ${{ github.event.inputs.prefix || ''}}
+      DEPENDENCY_TO_INSTALL: ${{ github.event.inputs.dependency_to_install || ''}}
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 1
+          path: arrow
+          repository: apache/arrow
+          ref: master
+          submodules: recursive
+      - name: Checkout Crossbow
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+          path: crossbow
+          repository: ursacomputing/crossbow
+          ref: master
+      - name: Set up Python
+        uses: actions/setup-python@v3
+        with:
+          cache: 'pip'
+          python-version: 3.8
+      - name: Install Archery
+        shell: bash
+        run: pip install -e arrow/dev/archery[all]
+#      - name: Download Artifacts
+#        run: |
+#          if [ -z $PREFIX ]; then
+#            PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+#          fi
+#          echo $PREFIX
+#          # problem about rate limit using github3 without API_TOKEN
+#          archery crossbow download-artifacts -f java-jars -t arrow_java_$(date +"%d-%m-%Y") $PREFIX
+#          if [ -n "$(ls -A arrow_java_$(date +"%d-%m-%Y")/*)" ]; then
+#            echo "Found files!"
+#            echo "GOT_FILES=true" >> $GITHUB_ENV
+#          else
+#            echo "No files found. Stopping upload."
+#            echo "GOT_FILES=false" >> $GITHUB_ENV
+#          fi
+#         tree arrow_java_$(date +"%d-%m-%Y")
+      - shell: bash
+        name: Download Artifacts
+        run: |
+          if [ -z $PREFIX ]; then
+            PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+          fi
+          if [ -z $DEPENDENCY_TO_INSTALL ]; then
+            DEPENDENCY_TO_INSTALL=arrow
+          fi
+          ARROW_JAVA_NIGHTLY_VERSION=$PREFIX'-github-java-jars'
+          TMP_FOLDER=arrow_java_$(date +%Y-%m-%d)
+          mkdir -p $TMP_FOLDER
+          pushd $TMP_FOLDER
+          # this download artifacts should be executed thru crossbow (workaround to solve problem about rate limit using github3 without API_TOKEN)
+          echo "**************** 1 - Download $ARROW_JAVA_NIGHTLY_VERSION dependencies ****************"
+          wget $( \
+            wget \
+              "-qO-" "https://api.github.com/repos/ursacomputing/crossbow/releases/tags/$ARROW_JAVA_NIGHTLY_VERSION" \
+              | jq -r '.assets[] | select((.name | endswith(".pom")) or (.name | endswith(".jar"))) | .browser_download_url' \
+              | grep $DEPENDENCY_TO_INSTALL )

Review Comment:
   Why are you not using `archery crossbow download-artifacts` for this?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org