Skip to content

Commit

Permalink
added a new github action and finalised some details
Browse files Browse the repository at this point in the history
  • Loading branch information
alirana01 committed Oct 18, 2023
1 parent 81fe82a commit e4522a4
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/run_idf_installer_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,36 @@ jobs:
run-idf-installer-build:
name: IDF Installer Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get IDE version from release tag
run: |
TAG=${{ github.event.release.tag_name }}
IDE_VERSION=${TAG#v}
echo "IDE Version is $IDE_VERSION"
echo "IDE_VERSION=$IDE_VERSION" >> $GITHUB_ENV
- name: Get latest release from espressif/esp-idf
run: |
RESPONSE=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/espressif/esp-idf/releases/latest)
TAG_NAME=$(echo "$RESPONSE" | jq -r '.tag_name')
IDF_VERSION=${TAG_NAME#v}
echo "Latest IDF Version is: $IDF_VERSION"
echo "IDF_VERSION=$IDF_VERSION" >> $GITHUB_ENV


- name: Trigger the Receiver Action
run: |
curl -XPOST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
"https://api.github.com/repos/espressif/idf-installer/dispatches" \
-d '{"event_type": "trigger-action", "client_payload": {"input_name": "value_here"}}'
curl -XPOST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
"https://api.github.com/repos/espressif/idf-installer/dispatches" \
-d "{\"event_type\": \"trigger-action\", \"client_payload\": {\"ide_version\": \"$IDE_VERSION\", \"idf_version\" : \"$IDF_VERSION\"}}"

0 comments on commit e4522a4

Please sign in to comment.