You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ri...@apache.org on 2023/05/23 02:05:09 UTC

[beam] branch master updated: Add workflow for staging java artifacts (#26825)

This is an automated email from the ASF dual-hosted git repository.

riteshghorse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new c31243ece6a Add workflow for staging java artifacts (#26825)
c31243ece6a is described below

commit c31243ece6a78e46ea2a25147643143d0ab20d93
Author: Danny McCormick <da...@google.com>
AuthorDate: Mon May 22 22:05:00 2023 -0400

    Add workflow for staging java artifacts (#26825)
    
    * Add everything needed to stage java artifacts except push
    
    * Fix var
    
    * Debug
    
    * Update build_release_candidate.yml
    
    * Update build_release_candidate.yml
    
    * Remove things specific to my repo
    
    * Remove extra echo
---
 .github/workflows/build_release_candidate.yml | 71 +++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/.github/workflows/build_release_candidate.yml b/.github/workflows/build_release_candidate.yml
index fbac8b97d50..58c825820ea 100644
--- a/.github/workflows/build_release_candidate.yml
+++ b/.github/workflows/build_release_candidate.yml
@@ -13,10 +13,20 @@ on:
       RC:
         description: Integer RC version for the release (e.g. 3 for RC3)
         required: true
+      APACHE_ID:
+        description: Your Apache id. Required if you want to stage artifacts into https://dist.apache.org/repos/dist/dev/beam/
+        required: false
+      APACHE_PASSWORD:
+        description: Your Apache password. Required if you want to stage artifacts into https://dist.apache.org/repos/dist/dev/beam/
+        required: false
       PUBLISH_JAVA_ARTIFACTS:
         description: Whether to publish java artifacts to https://repository.apache.org/#stagingRepositories (yes/no)
         required: true
         default: 'no'
+      STAGE_JAVA_SOURCE:
+        description: Whether to stage the java source into https://dist.apache.org/repos/dist/dev/beam/
+        required: true
+        default: 'no'
 
 jobs:
   publish_java_artifacts:
@@ -59,3 +69,64 @@ jobs:
         run: git config credential.helper store
       - name: Stage Java Artifacts into Maven
         run: ./gradlew publish -Psigning.gnupg.keyName=${{steps.import_gpg.outputs.fingerprint}} -PisRelease --no-daemon --no-parallel
+        
+      
+  stage_java_source:
+    if: ${{github.event.inputs.STAGE_JAVA_SOURCE == 'yes'}}
+    runs-on: ubuntu-latest
+    steps:
+      - name: Validate and mask apache id/password
+        run: |
+          echo "::add-mask::${{ github.event.inputs.APACHE_PASSWORD }}"
+          if [ "${{ github.event.inputs.APACHE_ID }}" == "" ]
+          then
+            echo "Must provide an apache id to stage artifacts to https://dist.apache.org/repos/dist/dev/beam/"
+          fi
+          if [ "${{ github.event.inputs.APACHE_PASSWORD }}" == "" ]
+          then
+            echo "Must provide an apache password to stage artifacts to https://dist.apache.org/repos/dist/dev/beam/"
+          fi
+      - name: Install Java 8
+        uses: actions/setup-java@v3
+        with:
+          distribution: 'temurin'
+          java-version: '8'
+      - name: Import GPG key
+        id: import_gpg
+        uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
+        with:
+          gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
+      - name: stage source
+        run: |
+            svn co https://dist.apache.org/repos/dist/dev/beam
+            mkdir -p beam/${{ github.event.inputs.RELEASE }}
+            cd beam/${{ github.event.inputs.RELEASE }}
+            RC_DIR="beam-${{ github.event.inputs.RELEASE }}-RC${{ github.event.inputs.RC }}"
+            RC_ZIP="${RC_DIR}.zip"
+            RELEASE_DIR="beam-${{ github.event.inputs.RELEASE }}"
+            RC_TAG="v${{ github.event.inputs.RELEASE }}-RC${{ github.event.inputs.RC }}"
+            SOURCE_RELEASE_ZIP="apache-beam-${RELEASE}-source-release.zip"
+              # Check whether there is an existing dist dir
+            if (svn ls "${SOURCE_RELEASE_ZIP}"); then
+              echo "Removing existing ${SOURCE_RELEASE_ZIP}."
+              svn delete "${SOURCE_RELEASE_ZIP}"
+            fi
+
+            echo "Downloading: https://github.com/apache/beam/archive/${RC_TAG}.zip"
+            wget https://github.com/apache/beam/archive/${RC_TAG}.zip  -O "${RC_ZIP}"
+
+            unzip "$RC_ZIP"
+            rm "$RC_ZIP"
+            mv "$RC_DIR" "$RELEASE_DIR"
+            zip -r "${SOURCE_RELEASE_ZIP}" "$RELEASE_DIR"
+            rm -r "$RELEASE_DIR"
+
+            echo "----Signing Source Release ${SOURCE_RELEASE_ZIP}-----"
+            gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --detach-sig "${SOURCE_RELEASE_ZIP}"
+
+            echo "----Creating Hash Value for ${SOURCE_RELEASE_ZIP}----"
+            sha512sum ${SOURCE_RELEASE_ZIP} > ${SOURCE_RELEASE_ZIP}.sha512
+
+            svn add --force .
+            svn status
+            svn commit -m "Staging Java artifacts for Apache Beam ${{ github.event.inputs.RELEASE }} RC${{ github.event.inputs.RC }}" --non-interactive --username ${{ github.event.inputs.APACHE_ID }} --password ${{ github.event.inputs.APACHE_PASSWORD }}