Skip to content

Commit

Permalink
Updated board release workflow for test purposes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Sep 11, 2024
1 parent 53caa87 commit 201808d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/boardReleaseLive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: "new-feature/boards/1"

jobs:
index_boards:
upload_board_assets_live:
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down
48 changes: 26 additions & 22 deletions .github/workflows/boardReleaseTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: "new-feature/boards/1"

jobs:
index_boards:
upload_board_assets_dev:
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down Expand Up @@ -47,11 +47,19 @@ jobs:
pip install packaging
sudo apt-get install p7zip-full
- name: Update Changelogs
id: changelog_update
run: |
python -u scripts/update_board_changelog.py
sdk_tag=$(<sdk_tag.txt)
rm sdk_tag.txt
echo "SDK Tag name is mikroSDK-$sdk_tag"
echo "sdk_tag_name=mikroSDK-$sdk_tag" >> $GITHUB_OUTPUT
python -u scripts/log_changes.py
- name: Upload Board Asset
run: |
if [[ ${{ steps.changelog_update.outputs.sdk_tag_name }} != "mikroSDK-0" ]]; then
python -u scripts/package.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ steps.changelog_update.outputs.sdk_tag_name }} "False"
fi
python -u scripts/package.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ steps.changelog_update.outputs.sdk_tag_name }} "False"
- name: Run Index Script
env:
Expand All @@ -60,25 +68,21 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
MIKROE_NECTO_AWS: ${{ secrets.MIKROE_NECTO_AWS }}
run: |
if [[ ${{ steps.changelog_update.outputs.sdk_tag_name }} != "mikroSDK-0" ]]; then
echo "Indexing to Test."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ steps.changelog_update.outputs.sdk_tag_name }} ${{ secrets.ES_INDEX_TEST }}
fi
echo "Indexing to Test."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ steps.changelog_update.outputs.sdk_tag_name }} ${{ secrets.ES_INDEX_TEST }}
- name: Trigger database update in Core repo
run: |
if [[ ${{ steps.changelog_update.outputs.sdk_tag_name }} != "mikroSDK-0" ]]; then
# Set the required variables
repo_owner="MikroElektronika"
repo_name="core_packages"
event_type="trigger-workflow"
version="${{ github.event.inputs.release_version }}"
# Set the required variables
repo_owner="MikroElektronika"
repo_name="core_packages"
event_type="trigger-workflow"
version="${{ github.event.inputs.release_version }}"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.MIKROE_ACTIONS_KEY }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"version\": \"$version\", \"index\": \"Test\", \"unit\": false, \"integration\": true}}"
fi
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.MIKROE_ACTIONS_KEY }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"version\": \"$version\", \"index\": \"Test\", \"unit\": false, \"integration\": true}}"

0 comments on commit 201808d

Please sign in to comment.