Skip to content

Commit ffdf348

Browse files
authored
Merge pull request #366 from appbaseio/feat/single-repo
Add changes in workflow to support separate ARC and SLS builds
2 parents 7731aaf + d26b064 commit ffdf348

2 files changed

Lines changed: 60 additions & 5 deletions

File tree

.github/workflows/binary-publish.yml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,25 @@ on:
44
types: [published]
55

66
jobs:
7-
build:
8-
name: Build
7+
determine_whether_to_run:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
build_arc: ${{ steps.check-build-arc.outputs.run_jobs }}
11+
build_sls: ${{ steps.check-build-sls.outputs.run_jobs }}
12+
13+
steps:
14+
- name: Check if Arc binary should be built
15+
id: check-build-arc
16+
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
17+
18+
- name: Check if SLS binary should be built
19+
id: check-build-sls
20+
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
21+
22+
build-arc:
23+
name: Build ARC binary
24+
needs: determine_whether_to_run
25+
if: needs.determine_whether_to_run.outputs.build_arc == 'true'
926
runs-on: ubuntu-latest
1027
timeout-minutes: 60
1128
steps:
@@ -48,11 +65,46 @@ jobs:
4865
script: |
4966
sh build.sh ${VERSION}
5067
51-
send-packer-event:
68+
build-sls:
69+
name: Build SLS binary
70+
needs: determine_whether_to_run
71+
if: needs.determine_whether_to_run.outputs.build_sls == 'true'
72+
runs-on: ubuntu-latest
73+
timeout-minutes: 60
74+
steps:
75+
- name: Checkout Repository
76+
uses: actions/checkout@v2
77+
- name: building binaries for eaas deployments
78+
uses: appleboy/ssh-action@master
79+
env:
80+
VERSION: ${{ github.event.release.tag_name }}
81+
with:
82+
host: ${{ secrets.GCLOUD_BUILD_HOST }}
83+
username: ${{ secrets.GCLOUD_BUILD_USERNAME }}
84+
key: ${{ secrets.GCLOUD_BUILD_KEY }}
85+
port: 22
86+
timeout: 3600s
87+
command_timeout: 3600s
88+
envs: VERSION
89+
script: |
90+
sh sls-build.sh ${VERSION} feat/true-sls
91+
92+
send-packer-event-arc:
93+
name: Send Packer Event
94+
needs: build-arc
95+
uses: ./.github/workflows/build_images.yml
96+
with:
97+
ref: ${{ github.ref }}
98+
event_name: new_release
99+
secrets:
100+
token: ${{ secrets.REPO_ACCESS_TOKEN }}
101+
102+
send-packer-event-sls:
52103
name: Send Packer Event
53-
needs: build
104+
needs: build-sls
54105
uses: ./.github/workflows/build_images.yml
55106
with:
56107
ref: ${{ github.ref }}
108+
event_name: new_sls_release
57109
secrets:
58110
token: ${{ secrets.REPO_ACCESS_TOKEN }}

.github/workflows/build_images.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
ref:
77
required: true
88
type: string
9+
event_name:
10+
required: true
11+
type: string
912
secrets:
1013
token:
1114
required: true
@@ -32,4 +35,4 @@ jobs:
3235
with:
3336
token: ${{ secrets.token }}
3437
repository: appbaseio-confidential/elasticsearch-packer-build
35-
event-type: new_release
38+
event-type: ${{ inputs.event_name }}

0 commit comments

Comments
 (0)