-
Notifications
You must be signed in to change notification settings - Fork 28
140 lines (131 loc) · 4.65 KB
/
binary-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: build binary
on:
release:
types: [published]
jobs:
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 }}
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Check if Arc binary should be built
id: check-build-arc
run: |
TAG_NAME="${{ github.event.release.tag_name }}"
echo "Checking tag $TAG_NAME for ARC build"
(echo "$TAG_NAME" | grep -Eq '^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: |
TAG_NAME="${{ github.event.release.tag_name }}"
echo "Checking tag $TAG_NAME for SLS build"
(echo "$TAG_NAME" | grep -Eq '^1\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs=false" >> $GITHUB_OUTPUT
- name: Get the version from the tag
id: get-version
run: echo "version=${{ github.event.release.tag_name }}" >> $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:
- name: Checkout Repository
uses: actions/checkout@v2
- name: building binaries for ami
uses: appleboy/[email protected]
env:
VERSION: ${{ github.event.release.tag_name }}
with:
host: ${{ secrets.AWS_BUILD_HOST }}
username: ${{ secrets.AWS_BUILD_USERNAME }}
key: ${{ secrets.AWS_BUILD_KEY }}
port: 22
envs: VERSION
script: |
export PATH=$PATH:/usr/local/go/bin && sh build.sh ${VERSION}
- name: Build AMI
uses: hashicorp/packer-github-actions@master
with:
command: build
target: "./ami.json"
env:
PACKER_LOG: 1
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
VERSION: ${{ github.event.release.tag_name }}
- name: building binaries for eaas deployments
uses: appleboy/[email protected]
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: |
source ~/.bashrc
export PATH=$PATH:/usr/local/go/bin:/usr/bin
export GOPATH=/home/centos/go
./build.sh ${VERSION}
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/[email protected]
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: |
source ~/.bashrc
export PATH=$PATH:/usr/local/go/bin:/usr/bin
export GOPATH=/home/centos/go
./sls-build.sh ${VERSION} feat/true-sls
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-sls
uses: ./.github/workflows/build_images.yml
with:
ref: ${{ github.ref }}
event_name: new_sls_release
secrets:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
send-docker-event-arc:
name: Send Docker Event
needs: [build-arc, determine_whether_to_run]
runs-on: ubuntu-latest
steps:
- name: Send repo dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: appbaseio-confidential/rs-api-server
event-type: publish_docker
client-payload: '{"version": "${{ needs.determine_whether_to_run.outputs.version }}" }'