v0.8.7 #33
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish SDK and Docs | |
| permissions: | |
| contents: read | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "publish" | |
| cancel-in-progress: false | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| # Docs must pass before SDK publish to PyPI. The publish docs task | |
| # depends on the PyPI publish task, so check docs build OK before | |
| # trying publishing to PyPI, then OK to publish docs themselves. | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx install poetry | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: poetry install --with dev,docs | |
| - name: Build project documentation | |
| uses: ./.github/actions/docsbuild | |
| tests: | |
| # run integration tests against production before releasing new version of sdk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| cache: "poetry" | |
| - name: Install dependencies | |
| run: poetry install --with dev | |
| - name: Run tests - Unit | |
| uses: ./.github/actions/tests/unit | |
| - name: Run tests - Integration | |
| uses: ./.github/actions/tests/integration | |
| env: | |
| url: "https://console.runzero.com" | |
| account_token: ${{ secrets.ACCOUNT_TOKEN }} | |
| org_token: ${{ secrets.ORG_TOKEN }} | |
| org_id: ${{ secrets.ORG_ID }} | |
| client_id: ${{ secrets.CLIENT_ID }} | |
| client_secret: ${{ secrets.CLIENT_SECRET }} | |
| validate_cert: "true" | |
| publish-release: | |
| needs: | |
| - docs | |
| - tests | |
| environment: | |
| name: publish-package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # for OpenID Connect trusted publisher to pypi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| - name: Install dependencies | |
| run: poetry install --no-interaction --no-root --without dev | |
| - name: Build package distributions | |
| shell: bash | |
| run: | | |
| rm -rf dist; | |
| poetry build --no-cache --no-interaction | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.13.0 | |
| publish-docs: | |
| needs: | |
| - publish-release | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment of Sphinx Docs to GitHub Pages | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| - name: Build project documentation | |
| uses: ./.github/actions/docsbuild | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'docs/build/html' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |