54 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Publish
 | 
						|
on:
 | 
						|
  push:
 | 
						|
    branches:
 | 
						|
      - "main"
 | 
						|
    paths-ignore:
 | 
						|
      - 'README.md'
 | 
						|
      - 'LICENSE.md'
 | 
						|
      - 'CHANGELOG.md'
 | 
						|
      - '.gitignore'
 | 
						|
      - 'renovate.json'
 | 
						|
      - 'CODEOWNERS'
 | 
						|
 | 
						|
jobs:
 | 
						|
  build:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    steps:
 | 
						|
      - name: Check out repository code
 | 
						|
        uses: actions/checkout@v3
 | 
						|
      - name: Setup Python
 | 
						|
        uses: actions/setup-python@v4
 | 
						|
        with:
 | 
						|
          python-version: "3.11"
 | 
						|
      - name: Install dependencies
 | 
						|
        run: |
 | 
						|
          pip install -r requirements.txt
 | 
						|
          pip install -r requirements-dev.txt
 | 
						|
          pip install setuptools wheel
 | 
						|
      - name: Build wheel file
 | 
						|
        run: python setup.py bdist_wheel
 | 
						|
      - id: skip_check
 | 
						|
        uses: actions/upload-artifact@v3
 | 
						|
        with:
 | 
						|
          name: whl
 | 
						|
          path: dist/
 | 
						|
 | 
						|
  publish:
 | 
						|
    needs: build
 | 
						|
    if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    steps:
 | 
						|
      - name: Create dist folder
 | 
						|
        run: |
 | 
						|
          mkdir -p dist
 | 
						|
      - uses: actions/download-artifact@v3
 | 
						|
        with:
 | 
						|
          name: whl
 | 
						|
          path: dist
 | 
						|
      - name: Publish to PyPI
 | 
						|
        uses: pypa/gh-action-pypi-publish@release/v1
 | 
						|
        with:
 | 
						|
          user: __token__
 | 
						|
          password: ${{ secrets.PYPI_API_TOKEN }}
 |