|
| 1 | +name: CD |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '[0-9].[0-9].[0-9]' |
| 7 | + - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest] |
| 15 | + python-version: [3.8] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + - name: Set up Python ${{ matrix.python-version }} |
| 20 | + uses: actions/setup-python@v2 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python-version }} |
| 23 | + - name: Install dependencies |
| 24 | + run: | |
| 25 | + python -m pip install --upgrade pip setuptools wheel |
| 26 | + python -m pip install tox tox-gh-actions twine |
| 27 | + - name: Test with tox |
| 28 | + run: tox |
| 29 | + env: |
| 30 | + STRUCTURIZR_WORKSPACE_ID: ${{ secrets.STRUCTURIZR_WORKSPACE_ID }} |
| 31 | + STRUCTURIZR_API_KEY: ${{ secrets.STRUCTURIZR_API_KEY }} |
| 32 | + STRUCTURIZR_API_SECRET: ${{ secrets.STRUCTURIZR_API_SECRET }} |
| 33 | + - name: Build package |
| 34 | + run: python setup.py sdist bdist_wheel |
| 35 | + - name: Check the package |
| 36 | + run: twine check dist/* |
| 37 | + - name: Publish to PyPI |
| 38 | + env: |
| 39 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 40 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 41 | + run: |
| 42 | + twine upload --skip-existing --non-interactive dist/* |
| 43 | + - name: Create GitHub release |
| 44 | + uses: actions/create-release@v1 |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + with: |
| 48 | + tag_name: ${{ github.ref }} |
| 49 | + release_name: ${{ github.ref }} |
| 50 | + body: > |
| 51 | + Please see |
| 52 | + https://github.com/${{ github.repository }}/blob/${GITHUB_REF#refs/heads/}/CHANGELOG.rst |
| 53 | + for the full release notes. |
| 54 | + draft: false |
| 55 | + prerelease: false |
0 commit comments