mirror of
https://github.com/LukeHagar/api-specs.git
synced 2025-12-06 04:19:09 +00:00
90 lines
2.7 KiB
YAML
90 lines
2.7 KiB
YAML
name: "Build and push python sdk"
|
|
|
|
env:
|
|
SAIL_CLIENT_ID: ${{ secrets.SDK_TEST_TENANT_CLIENT_ID }}
|
|
SAIL_CLIENT_SECRET: ${{ secrets.SDK_TEST_TENANT_CLIENT_SECRET }}
|
|
SAIL_BASE_URL: ${{ secrets.SDK_TEST_TENANT_BASE_URL }}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- idn/**
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
push_spec_workflow:
|
|
name: Build and push python SDK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Checkout the master branch request to run rsync
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
|
|
# Checkout the main branch of api-specs
|
|
- name: Checkout API Specs Repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: sailpoint-oss/python-sdk
|
|
path: python-sdk
|
|
ref: main
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16"
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Run Prescript
|
|
id: prescript
|
|
run: |
|
|
cd python-sdk
|
|
node sdk-resources/prescript.js ../idn/
|
|
|
|
- name: Build V3 SDK
|
|
id: buildV3
|
|
if: steps.prescript.outcome == 'success'
|
|
run: |
|
|
cd python-sdk
|
|
rm -rf ./sailpoint/v3
|
|
java -jar openapi-generator-cli-7.0.1.jar generate -i ../idn/sailpoint-api.v3.yaml -g python -o sailpoint --global-property skipFormModel=false --config sdk-resources/v3-config.yaml --enable-post-process-file
|
|
|
|
- name: Build Beta SDK
|
|
id: buildBeta
|
|
if: steps.buildV3.outcome == 'success'
|
|
run: |
|
|
cd python-sdk
|
|
rm -rf ./sailpoint/beta
|
|
java -jar openapi-generator-cli-7.0.1.jar generate -i ../idn/sailpoint-api.beta.yaml -g python -o sailpoint --global-property skipFormModel=false --config sdk-resources/beta-config.yaml --enable-post-process-file
|
|
node sdk-resources/postscript.js ./sailpoint/beta
|
|
|
|
- name: After SDK Build
|
|
if: steps.buildBeta.outcome == 'success'
|
|
run: |
|
|
cd python-sdk/
|
|
pip install -r requirements.txt
|
|
pip install -e sailpoint
|
|
python validation_test.py -v
|
|
|
|
git config --unset-all http.https://github.com/.extraheader
|
|
git config --local user.email "devrel-service@sailpoint.com"
|
|
git config --local user.name "GitHub Action Bot"
|
|
|
|
git add .
|
|
git commit -m "Automated build '${{ github.event.head_commit.message }}' python sdk: ${{ github.run_id }}"
|
|
|
|
git status
|
|
|
|
git remote set-url origin https://${{secrets.DEVREL_SERVICE_TOKEN}}@github.com/sailpoint-oss/python-sdk.git
|
|
|
|
git remote -v
|
|
|
|
git push
|