Skip to content

Commit 596c896

Browse files
Updated board release workflow for test purposes #13
1 parent 93cf909 commit 596c896

File tree

1 file changed

+88
-87
lines changed

1 file changed

+88
-87
lines changed

.github/workflows/boardRelease.yaml

Lines changed: 88 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -52,94 +52,95 @@ jobs:
5252
5353
echo "$PR_RESPONSE" > pr_response.json
5454
PR_NUMBER=$(jq '.number' pr_response.json)
55-
PR_NUMBER=30
55+
echo "PR NUMBER IS: ${PR_NUMBER}"
56+
echo $PR_RESPONSE
5657
rm pr_response.json
5758
echo "Pull request number is $PR_NUMBER"
5859
echo "pull_request_number=$PR_NUMBER" >> $GITHUB_OUTPUT
5960
60-
# Automatically approve PR
61-
- name: Approve Pull Request
62-
run: |
63-
curl -X POST \
64-
-H "Authorization: token ${{ secrets.MIKROE_ACTIONS_KEY }}" \
65-
-H "Accept: application/vnd.github+json" \
66-
https://api.github.com/repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull_request_number }}/reviews \
67-
-d '{"event":"APPROVE"}'
68-
69-
# Automatically merge the pull request using the GitHub API
70-
- name: Automatically Merge Pull Request
71-
run: |
72-
PR_NUMBER=${{ steps.create_pr.outputs.pull_request_number }}
73-
curl -s -X PUT \
74-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
75-
-H "Accept: application/vnd.github+json" \
76-
https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/merge \
77-
-d "{\"commit_title\":\"Auto-merged PR from ${{ github.event.inputs.release_branch }} to master\",\"merge_method\":\"squash\"}"
78-
79-
- name: Handle Merge Conflict
80-
if: failure()
81-
run: echo "::error::Merge conflict occurred. Please resolve manually."
82-
83-
- name: Checkout to master
84-
run: |
85-
git fetch origin
86-
git checkout master
87-
git pull origin master
88-
89-
- name: Set up Python
90-
uses: actions/setup-python@v5
91-
with:
92-
python-version: '3.x'
93-
94-
- name: Install Dependencies
95-
run: |
96-
python -m pip install --upgrade pip
97-
pip install aiohttp
98-
pip install aiofiles
99-
pip install requests
100-
pip install py7zr
101-
pip install chardet
102-
pip install elasticsearch==7.13.4
103-
pip install packaging
104-
sudo apt-get install p7zip-full
105-
106-
- name: Update Changelogs
107-
run: |
108-
python -u scripts/update_board_changelog.py
109-
python -u scripts/log_changes.py
110-
111-
- name: Commit Changelog to master
112-
run: |
113-
echo "Updating with new changelog files";
114-
git add changelog/**
115-
git commit -m "Updated changelog files with latest merged release."
116-
git push
117-
118-
- name: Upload Board Asset
119-
run: python -u scripts/package.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.release.tag_name }} "True"
120-
121-
- name: Run Index Script
122-
env:
123-
ES_HOST: ${{ secrets.ES_HOST }}
124-
ES_USER: ${{ secrets.ES_USER }}
125-
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
126-
MIKROE_NECTO_AWS: ${{ secrets.MIKROE_NECTO_AWS }}
127-
run: |
128-
echo "Indexing to Test."
129-
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ github.event.inputs.release_version }} ${{ secrets.ES_INDEX_TEST }}
130-
131-
- name: Trigger database update in Core repo
132-
run: |
133-
# Set the required variables
134-
repo_owner="MikroElektronika"
135-
repo_name="core_packages"
136-
event_type="trigger-workflow"
137-
version="${{ github.event.inputs.release_version }}"
138-
139-
curl -L \
140-
-X POST \
141-
-H "Accept: application/vnd.github+json" \
142-
-H "Authorization: Bearer ${{ secrets.MIKROE_ACTIONS_KEY }}" \
143-
-H "X-GitHub-Api-Version: 2022-11-28" \
144-
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
145-
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"version\": \"$version\", \"index\": \"Test\", \"unit\": false, \"integration\": true}}"
61+
# # Automatically approve PR
62+
# - name: Approve Pull Request
63+
# run: |
64+
# curl -X POST \
65+
# -H "Authorization: token ${{ secrets.MIKROE_ACTIONS_KEY }}" \
66+
# -H "Accept: application/vnd.github+json" \
67+
# https://api.github.com/repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull_request_number }}/reviews \
68+
# -d '{"event":"APPROVE"}'
69+
70+
# # Automatically merge the pull request using the GitHub API
71+
# - name: Automatically Merge Pull Request
72+
# run: |
73+
# PR_NUMBER=${{ steps.create_pr.outputs.pull_request_number }}
74+
# curl -s -X PUT \
75+
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
76+
# -H "Accept: application/vnd.github+json" \
77+
# https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/merge \
78+
# -d "{\"commit_title\":\"Auto-merged PR from ${{ github.event.inputs.release_branch }} to master\",\"merge_method\":\"squash\"}"
79+
80+
# - name: Handle Merge Conflict
81+
# if: failure()
82+
# run: echo "::error::Merge conflict occurred. Please resolve manually."
83+
84+
# - name: Checkout to master
85+
# run: |
86+
# git fetch origin
87+
# git checkout master
88+
# git pull origin master
89+
90+
# - name: Set up Python
91+
# uses: actions/setup-python@v5
92+
# with:
93+
# python-version: '3.x'
94+
95+
# - name: Install Dependencies
96+
# run: |
97+
# python -m pip install --upgrade pip
98+
# pip install aiohttp
99+
# pip install aiofiles
100+
# pip install requests
101+
# pip install py7zr
102+
# pip install chardet
103+
# pip install elasticsearch==7.13.4
104+
# pip install packaging
105+
# sudo apt-get install p7zip-full
106+
107+
# - name: Update Changelogs
108+
# run: |
109+
# python -u scripts/update_board_changelog.py
110+
# python -u scripts/log_changes.py
111+
112+
# - name: Commit Changelog to master
113+
# run: |
114+
# echo "Updating with new changelog files";
115+
# git add changelog/**
116+
# git commit -m "Updated changelog files with latest merged release."
117+
# git push
118+
119+
# - name: Upload Board Asset
120+
# run: python -u scripts/package.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.release.tag_name }} "True"
121+
122+
# - name: Run Index Script
123+
# env:
124+
# ES_HOST: ${{ secrets.ES_HOST }}
125+
# ES_USER: ${{ secrets.ES_USER }}
126+
# ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
127+
# MIKROE_NECTO_AWS: ${{ secrets.MIKROE_NECTO_AWS }}
128+
# run: |
129+
# echo "Indexing to Test."
130+
# python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ github.event.inputs.release_version }} ${{ secrets.ES_INDEX_TEST }}
131+
132+
# - name: Trigger database update in Core repo
133+
# run: |
134+
# # Set the required variables
135+
# repo_owner="MikroElektronika"
136+
# repo_name="core_packages"
137+
# event_type="trigger-workflow"
138+
# version="${{ github.event.inputs.release_version }}"
139+
140+
# curl -L \
141+
# -X POST \
142+
# -H "Accept: application/vnd.github+json" \
143+
# -H "Authorization: Bearer ${{ secrets.MIKROE_ACTIONS_KEY }}" \
144+
# -H "X-GitHub-Api-Version: 2022-11-28" \
145+
# https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
146+
# -d "{\"event_type\": \"$event_type\", \"client_payload\": {\"version\": \"$version\", \"index\": \"Test\", \"unit\": false, \"integration\": true}}"

0 commit comments

Comments
 (0)