Skip to content

Commit 4d11544

Browse files
Mohammad Mahdi MalmasiMohammad Mahdi Malmasi
authored andcommitted
build check run rule changed and trigger build CIs script added
1 parent 6fc02fd commit 4d11544

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

.github/workflows/build_and_push_python_codes.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
DESTINATION_TOKEN: ${{ secrets.PYTHON_DESTINATION_TOKEN }}
1515

1616
jobs:
17-
build_and_push:
17+
build:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout source code
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build
3030
run: |
3131
make generate_python_protos
32-
32+
3333
- name: Checkout destination repo
3434
uses: actions/checkout@v2
3535
with:
@@ -46,8 +46,7 @@ jobs:
4646
4747
- name: Commit changes
4848
run: |
49-
export TAG_NAME=$(basename ${{ github.ref }})
50-
bash -c "if [[ ${{ github.ref }} == 'master' ]]; then export TAG_NAME=${{ github.event.client_payload.tag_name }}; fi"
49+
bash -c "if [[ ${{ github.ref }} == 'refs/tags/'* ]]; then export TAG_NAME=${{ github.ref }}; fi"
5150
echo "Tag name: $TAG_NAME"
5251
echo "payload: ${{ github.event.client_payload.tag_name }}"
5352
cd destination-repo
@@ -58,3 +57,5 @@ jobs:
5857
git tag $TAG_NAME
5958
git push --tags
6059
git push origin master
60+
env:
61+
TAG_NAME: ${{ github.event.client_payload.tag_name }}

.github/workflows/buildable_check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Check that new changes can build or not
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
- '!master'
48

59
jobs:
610
build:

.github/workflows/set_new_version_tag.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ jobs:
1919
needs: set-version-tag
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: Trigger Python Build CI
23-
uses: peter-evans/repository-dispatch@v1
24-
with:
25-
token: ${{ github.token }}
26-
repository: ECTLab/AIaaS-gRPC-protos
27-
event-type: tag-created
28-
client-payload: '{"tag_name": "$(git tag --sort=-version:refname --list `v[0-9]*.[0-9]*.[0-9]*` | head -n1)"}'
22+
- name: Checkout Code
23+
uses: actions/checkout@v2
24+
- name: Send tag-created event
25+
run: |
26+
git fetch --tags
27+
export LAST_TAG=$(git tag --sort=-version:refname --list 'v[0-9]*.[0-9]*.[0-9]*' | head -n1)
28+
echo "LAST_TAG=$LAST_TAG"
29+
curl -L \
30+
-X POST \
31+
-H "Accept: application/vnd.github+json" \
32+
-H "Authorization: Bearer ${{ github.token }}" \
33+
-H "X-GitHub-Api-Version: 2022-11-28" \
34+
https://api.github.com/repos/ECTLab/AIaaS-gRPC-protos/dispatches \
35+
-d '{"event_type":"tag-created","client_payload":{"tag_name":"'"$LAST_TAG"'"}}'

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ clean:
99
set_new_version_tag:
1010
bash ./scripts/generate_new_version_tag.sh
1111

12+
trigger_build_CIs:
13+
bash ./scripts/trigger_build_CIs.sh $(filter-out $@,$(MAKECMDGOALS))
14+
1215
install_python_requirements:
1316
pip install -r $(PYTHON_REQUIREMENTS_FILE_PATH)
1417

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export TH="HELLO"

0 commit comments

Comments
 (0)