Skip to content

Commit

Permalink
Trigger osc-sdk-python auto-build on release
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Jutteau <[email protected]>
  • Loading branch information
jerome-jutteau authored and outscale-gmt committed Jul 19, 2021
1 parent 87c5e83 commit d57f92f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/scripts/build-osc-sdk-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

if [ -z "$API_VERSION" ]; then
echo "API_VERSION is missing, abort"
echo "pass API_VERSION through environment variable"
exit 1
fi

if [ -z "$GH_TOKEN" ]; then
echo "GH_TOKEN is missing, abort."
echo "pass GH_TOKEN through environment variable"
exit 1
fi

ghurl="https://api.github.com"
data="{\"ref\": \"master\", \"inputs\": {\"api_version\": \"$API_VERSION\"}"
curl \
-X POST \
-H "Authorization: token $GH_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-d "${data}" \
"${ghurl}/repos/outscale/osc-sdk-python/actions/workflows/build.yml/dispatches"
5 changes: 5 additions & 0 deletions .github/workflows/release-osc-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN_OSC_SDK_GO }}
API_VERSION: ${{ steps.release.outputs.TAG }}
run: .github/scripts/build-osc-sdk-go.sh
- name: Trigger osc-sdk-python build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_OSC_SDK_PYTHON }}
API_VERSION: ${{ steps.release.outputs.TAG }}
run: .github/scripts/build-osc-sdk-python.sh

0 comments on commit d57f92f

Please sign in to comment.