|
6 | 6 |
|
7 | 7 | jobs:
|
8 | 8 | deploy:
|
9 |
| - |
10 | 9 | runs-on: ubuntu-latest
|
11 | 10 |
|
12 | 11 | steps:
|
13 |
| - - uses: actions/checkout@v2 |
14 |
| - - name: Set up Python |
15 |
| - uses: actions/setup-python@v2 |
16 |
| - with: |
17 |
| - python-version: '3.x' |
18 |
| - - name: Install dependencies |
19 |
| - run: | |
20 |
| - python -m pip install --upgrade pip |
21 |
| - pip install build |
22 |
| - pip install -r ./requirements.txt |
23 |
| - pip install -r ./test-requirements.txt |
24 |
| - - name: Build package |
25 |
| - run: python -m build |
26 |
| - - name: Test package |
27 |
| - run: pytest -s -v --cov=Avalara.SDK --username=${{ secrets.API_USERNAME }} --password=${{ secrets.API_PASSWORD }} |
28 |
| - - name: Publish package |
29 |
| - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 |
30 |
| - with: |
31 |
| - user: __token__ |
32 |
| - password: ${{ secrets.PYPI_API_TOKEN }} |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v2 |
| 15 | + with: |
| 16 | + python-version: "3.x" |
| 17 | + - name: Retrieve bearer token |
| 18 | + id: get_bearer_token |
| 19 | + run: | |
| 20 | + response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \ |
| 21 | + -H "Content-Type: application/x-www-form-urlencoded" \ |
| 22 | + -d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}") |
| 23 | + token=$(echo $response | jq -r '.access_token') |
| 24 | + echo "BEARER_TOKEN=${token}" >> $GITHUB_ENV |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install build |
| 29 | + pip install -r ./requirements.txt |
| 30 | + pip install -r ./test-requirements.txt |
| 31 | + - name: Build package |
| 32 | + run: python -m build |
| 33 | + - name: Test package |
| 34 | + run: pytest -s -v --cov=Avalara.SDK --username=${{ secrets.API_USERNAME }} --password=${{ secrets.API_PASSWORD }} |
| 35 | + - name: Publish package |
| 36 | + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 |
| 37 | + with: |
| 38 | + user: __token__ |
| 39 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments