From cb65ac2bbbcaa91cbd092200ce706b60a3436e58 Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Mon, 2 Jan 2023 21:59:11 +0530 Subject: [PATCH 1/2] Add changes in workflow to support separate ARC and SLS builds --- .github/workflows/binary-publish.yml | 60 ++++++++++++++++++++++++++-- .github/workflows/build_images.yml | 5 ++- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/.github/workflows/binary-publish.yml b/.github/workflows/binary-publish.yml index e85604ae..f578f4b6 100644 --- a/.github/workflows/binary-publish.yml +++ b/.github/workflows/binary-publish.yml @@ -4,8 +4,25 @@ on: types: [published] jobs: - build: - name: Build + determine_whether_to_run: + runs-on: ubuntu-latest + outputs: + build_arc: ${{ steps.check-build-arc.outputs.run_jobs }} + build_sls: ${{ steps.check-build-sls.outputs.run_jobs }} + + steps: + - name: Check if Arc binary should be built + id: check-build-arc + run: (echo "${{ github.ref }}" | grep -Eq '^refs\/tags\/8\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs==false" >> $GITHUB_OUTPUT + + - name: Check if SLS binary should be built + id: check-build-sls + run: (echo "${{ github.ref }}" | grep -Eq '^refs\/tags\/1\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs==false" >> $GITHUB_OUTPUT + + build-arc: + name: Build ARC binary + needs: determine_whether_to_run + if: needs.determine_whether_to_run.outputs.build_arc == 'true' runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -48,11 +65,46 @@ jobs: script: | sh build.sh ${VERSION} - send-packer-event: + build-sls: + name: Build SLS binary + needs: determine_whether_to_run + if: needs.determine_whether_to_run.outputs.build_sls == 'true' + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: building binaries for eaas deployments + uses: appleboy/ssh-action@master + env: + VERSION: ${{ github.event.release.tag_name }} + with: + host: ${{ secrets.GCLOUD_BUILD_HOST }} + username: ${{ secrets.GCLOUD_BUILD_USERNAME }} + key: ${{ secrets.GCLOUD_BUILD_KEY }} + port: 22 + timeout: 3600s + command_timeout: 3600s + envs: VERSION + script: | + sh sls-build.sh ${VERSION} + + send-packer-event-arc: + name: Send Packer Event + needs: build-arc + uses: ./.github/workflows/build_images.yml + with: + ref: ${{ github.ref }} + event_name: new_release + secrets: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + + send-packer-event-sls: name: Send Packer Event - needs: build + needs: build-sls uses: ./.github/workflows/build_images.yml with: ref: ${{ github.ref }} + event_name: new_sls_release secrets: token: ${{ secrets.REPO_ACCESS_TOKEN }} diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index c79f31b2..d2bbc8a4 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -6,6 +6,9 @@ on: ref: required: true type: string + event_name: + required: true + type: string secrets: token: required: true @@ -32,4 +35,4 @@ jobs: with: token: ${{ secrets.token }} repository: appbaseio-confidential/elasticsearch-packer-build - event-type: new_release + event-type: ${{ inputs.event_name }} From d26b064deb9104f9710c51f949f7a4f07bd7959e Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Tue, 17 Jan 2023 17:03:41 +0530 Subject: [PATCH 2/2] Specify the branch for SLS builds --- .github/workflows/binary-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/binary-publish.yml b/.github/workflows/binary-publish.yml index f578f4b6..1236ea17 100644 --- a/.github/workflows/binary-publish.yml +++ b/.github/workflows/binary-publish.yml @@ -87,7 +87,7 @@ jobs: command_timeout: 3600s envs: VERSION script: | - sh sls-build.sh ${VERSION} + sh sls-build.sh ${VERSION} feat/true-sls send-packer-event-arc: name: Send Packer Event