Skip to content

Commit 44ac3f1

Browse files
Mohammad Mahdi MalmasiMohammad Mahdi Malmasi
authored andcommitted
build and push golang codes CI added
1 parent c30aaa2 commit 44ac3f1

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push Tag to https://github.com/ECTLab/AIaaS-gRPC-protos-Autogenerated-Golang
2+
3+
on: [push]
4+
5+
env:
6+
DESTINATION_REPO: ECTLab/AIaaS-gRPC-protos-Autogenerated-Golang
7+
DESTINATION_BRANCH: master
8+
DESTINATION_TOKEN: ${{ secrets.PYTHON_DESTINATION_TOKEN }}
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source code
15+
uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.ref }}
18+
19+
- name: Install dependencies
20+
run: |
21+
make install_python_requirements
22+
23+
- name: Build
24+
run: |
25+
export PATH=$PATH:$(go env GOPATH)/bin
26+
make generate_golang_protos
27+
ls -l ./golang
28+
29+
# - name: Checkout destination repo
30+
# uses: actions/checkout@v2
31+
# with:
32+
# repository: ${{ env.DESTINATION_REPO }}
33+
# ref: ${{ env.DESTINATION_BRANCH }}
34+
# token: ${{ env.DESTINATION_TOKEN }}
35+
# path: destination-repo
36+
37+
# - name: Copy files
38+
# run: |
39+
# rm -rf destination-repo/AIaaS_interface/
40+
# mkdir -p destination-repo/AIaaS_interface/
41+
# cp -r AIaaS_interface/* destination-repo/AIaaS_interface/
42+
43+
# - name: Commit changes
44+
# run: |
45+
# bash -c "if [[ ${{ github.ref }} == 'refs/tags/'* ]]; then export TAG_NAME=${{ github.ref }}; fi"
46+
# echo "Tag name: $TAG_NAME"
47+
# echo "payload: ${{ github.event.client_payload.tag_name }}"
48+
# cd destination-repo
49+
# git config user.email "m.mahdi.m79@gmail.com"
50+
# git config user.name "Mohammad Mahdi Malmasi"
51+
# git add .
52+
# git commit -m "Update for tag: $TAG_NAME"
53+
# git tag $TAG_NAME
54+
# git push --tags
55+
# git push origin master
56+
# env:
57+
# TAG_NAME: ${{ github.event.client_payload.tag_name }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ install_python_requirements:
1515

1616
install_golang_requirements:
1717
sudo apt-get update && sudo apt-get install -y protobuf-compiler
18-
go install google.golang.org/protobuf/cmd/protoc-gen-go
19-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
18+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
19+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
2020

2121
generate_python_protos: clean install_python_requirements
2222
mkdir $(PYTHON_PROTOS_OUTPUT_DIR)

0 commit comments

Comments
 (0)