Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/build_and_push_golang_codes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Push Tag to https://github.com/ECTLab/AIaaS-gRPC-protos-Autogenerated-Golang

on: [push]

env:
DESTINATION_REPO: ECTLab/AIaaS-gRPC-protos-Autogenerated-Golang
DESTINATION_BRANCH: master
DESTINATION_TOKEN: ${{ secrets.PYTHON_DESTINATION_TOKEN }}

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Install dependencies
run: |
make install_golang_requirements

- name: Build
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make generate_golang_protos
ls -l ./golang

# - name: Checkout destination repo
# uses: actions/checkout@v2
# with:
# repository: ${{ env.DESTINATION_REPO }}
# ref: ${{ env.DESTINATION_BRANCH }}
# token: ${{ env.DESTINATION_TOKEN }}
# path: destination-repo

# - name: Copy files
# run: |
# rm -rf destination-repo/AIaaS_interface/
# mkdir -p destination-repo/AIaaS_interface/
# cp -r AIaaS_interface/* destination-repo/AIaaS_interface/

# - name: Commit changes
# run: |
# bash -c "if [[ ${{ github.ref }} == 'refs/tags/'* ]]; then export TAG_NAME=${{ github.ref }}; fi"
# echo "Tag name: $TAG_NAME"
# echo "payload: ${{ github.event.client_payload.tag_name }}"
# cd destination-repo
# git config user.email "m.mahdi.m79@gmail.com"
# git config user.name "Mohammad Mahdi Malmasi"
# git add .
# git commit -m "Update for tag: $TAG_NAME"
# git tag $TAG_NAME
# git push --tags
# git push origin master
# env:
# TAG_NAME: ${{ github.event.client_payload.tag_name }}
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
PROTOS_DIR=./protos
PYTHON_PROTOS_OUTPUT_DIR=./AIaaS_interface
PYTHON_REQUIREMENTS_FILE_PATH=./requirements.txt

GOLANG_PROTOS_OUTPUT_DIR=./golang

clean:
rm -rf $(PYTHON_PROTOS_OUTPUT_DIR)
rm -rf $(GOLANG_PROTOS_OUTPUT_DIR)

set_new_version_tag:
bash ./scripts/generate_new_version_tag.sh

install_python_requirements:
pip install -r $(PYTHON_REQUIREMENTS_FILE_PATH)

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

generate_python_protos: clean install_python_requirements
mkdir $(PYTHON_PROTOS_OUTPUT_DIR)
find $(PROTOS_DIR) -name "*.proto" \
Expand All @@ -21,3 +27,11 @@ generate_python_protos: clean install_python_requirements
--pyi_out=$(PYTHON_PROTOS_OUTPUT_DIR) \
--grpc_python_out=$(PYTHON_PROTOS_OUTPUT_DIR) {} \;
bash ./scripts/add_init_files.sh $(PYTHON_PROTOS_OUTPUT_DIR)

generate_golang_protos: clean install_golang_requirements
mkdir $(GOLANG_PROTOS_OUTPUT_DIR)
find $(PROTOS_DIR) -name "*.proto" \
-exec protoc \
-I./protos \
--go_out=$(GOLANG_PROTOS_OUTPUT_DIR) \
--go-grpc_out=$(GOLANG_PROTOS_OUTPUT_DIR) {} \;
2 changes: 2 additions & 0 deletions protos/platform_management/notification_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package platform_managment;

option go_package = "https://github.com/ECTLab/AIaaS-gRPC-protos-Autogenerated-Golang.git/AIaaS_interface/platform_managment/";


message SendEmailRequest {
string email = 1;
Expand Down