diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..a62b5e15 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,61 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Lint with flake8 + run: | + python -m pip install flake8 + flake8 graphene_mongo --count --show-source --statistics + - name: Install dependencies + run: | + python -m pip install poetry + poetry config virtualenvs.create false + poetry install --with dev + - name: Run Tests + run: make test + - name: Build Package + run: | + poetry build + + publish: + needs: build + runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + - name: Build package + run: | + poetry build + - name: Build package + run: | + poetry build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 72d6825d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.8" -install: - pip install -r requirements.txt -script: make test -after_success: - - coveralls -