From e13b87f03e9bfe998e2b931785c51014be9d5e7f Mon Sep 17 00:00:00 2001 From: "Ariel Shaqed (Scolnicov)" Date: Wed, 27 Sep 2023 18:38:06 +0300 Subject: [PATCH] Add legacy publish action The existing java-api-client "deploy" job should publish the new SDK. Add a job to publish the old API. We will get rid of it after releasing 1.0. --- .github/workflows/java-api-client.yaml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/java-api-client.yaml b/.github/workflows/java-api-client.yaml index 126042400b1..cd406adba6b 100644 --- a/.github/workflows/java-api-client.yaml +++ b/.github/workflows/java-api-client.yaml @@ -9,6 +9,48 @@ on: description: Tag/version to publish jobs: + deploy-legacy: # TODO(1.0): Remove this job after releasing 1.0 + runs-on: ubuntu-20.04 + environment: Treeverse signing + steps: + - name: Checkout + uses: actions/checkout@v3 + + # Extract the version to 'version' based on workflow_dispatch or triggered tag in the published event + - name: Extract version + shell: bash + run: | + if [ "${{ github.event.inputs.tag }}" != "" ]; then + echo "tag=$(echo ${{ github.event.inputs.tag }} | sed s/^v//)" >> $GITHUB_OUTPUT + else + echo "tag=$(echo ${GITHUB_REF##*/} | sed s/^v//)" >> $GITHUB_OUTPUT + fi + id: version + + - name: Java generate package + run: make client-java-legacy PACKAGE_VERSION=${{ steps.version.outputs.tag }} + + - name: Install secret key for signing + run: | + cat <(echo -e '${{ secrets.OSSRH_GPG_SECRET_KEY }}') | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Set up Java and Maven Central Repository + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Build and publish package + working-directory: clients/java-legacy + run: mvn --batch-mode deploy -Dgpg.executable="${GITHUB_WORKSPACE}/scripts/gpg_loopback.sh" --activate-profiles sign-artifacts + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + deploy: runs-on: ubuntu-20.04 environment: Treeverse signing