File: deploy.yaml

package info (click to toggle)
python-cyclopts 3.12.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,288 kB
  • sloc: python: 11,445; makefile: 24
file content (72 lines) | stat: -rw-r--r-- 2,051 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build package and push to PyPi

on:
  workflow_dispatch:
  push:
    tags:
      - "v*.*.*"

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      PYTHON: 3.12
      POETRY_HOME: "~/poetry"

    steps:
      - name: Check out repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Includes getting tags

      - name: Set up python ${{ env.PYTHON }}
        id: setup-python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON }}

      - name: Cache Poetry Install
        uses: actions/cache@v4
        id: cached-poetry
        with:
          path: ${{ env.POETRY_HOME }}
          key: poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/deploy.yaml') }}

      - name: Install poetry
        uses: snok/install-poetry@v1
        if: steps.cached-poetry.outputs.cache-hit != 'true'

      - name: Add Poetry to PATH # Needs to be separate from install-poetry because cache.
        run: |
          echo "$POETRY_HOME/bin" >> $GITHUB_PATH

      - name: Configure Poetry # Needs to be separate from install-poetry because cache.
        run: |
          poetry self add poetry-dynamic-versioning[plugin]
          poetry config virtualenvs.create true
          poetry config virtualenvs.in-project true

      - name: Cache venv
        uses: actions/cache@v4
        id: cached-venv
        with:
          path: .venv/
          key: venv-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/deploy.yaml') }}

      - name: Install project
        run: poetry install --no-interaction

      - name: Build package
        run: poetry build

      - name: Publish package
        if: github.event_name != 'workflow_dispatch'
        run: |
          poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
          poetry publish

      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: dist
          path: dist/