Skip to content

fix: do not expose restricted projections #356

fix: do not expose restricted projections

fix: do not expose restricted projections #356

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-formatting:
runs-on: ubuntu-latest
container:
image: python:3
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check formatting
uses: psf/black@stable
with:
options: "--check"
src: .
version: "~= 22.0"
run-tests:
runs-on: ubuntu-latest
name: Run tests (${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run pytest
run: |
curl -sSL https://install.python-poetry.org | python
poetry install
poetry run python -m pytest --disable-pytest-warnings
env:
FTRACK_SERVER: ${{ secrets.FTRACK_SERVER }}
FTRACK_API_USER: ${{ secrets.FTRACK_API_USER }}
FTRACK_API_KEY: ${{ secrets.FTRACK_API_KEY_UNITTEST }}
build:
runs-on: ubuntu-latest
name: Build package distribution
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build
run: |
curl -sSL https://install.python-poetry.org | python
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --only=dev --no-interaction
poetry build --format=wheel
poetry run twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
publish-test:
name: Publish to PyPi (test)
runs-on: ubuntu-latest
needs: [run-tests, build]
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: staging
url: https://test.pypi.org/project/ftrack-python-api/
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Download package
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to Test PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
publish-prod:
name: Publish to PyPi (prod)
runs-on: ubuntu-latest
needs: [run-tests, build]
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: production
url: https://pypi.org/project/ftrack-python-api/
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Download package
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}