|
4 | 4 | tags: |
5 | 5 | - "v*.*.*" |
6 | 6 | jobs: |
| 7 | + lint: |
| 8 | + runs-on: ubuntu-24.04 |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - name: Set up Python 3.13 |
| 12 | + uses: actions/setup-python@v5 |
| 13 | + with: |
| 14 | + python-version: "3.13" |
| 15 | + - name: Install Poetry |
| 16 | + run: pip install poetry |
| 17 | + - name: Update PATH |
| 18 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 19 | + - name: Update Poetry configuration |
| 20 | + run: poetry config virtualenvs.create false |
| 21 | + - name: Install dependencies |
| 22 | + run: poetry install --only dev --no-interaction |
| 23 | + - name: Ruff Linter |
| 24 | + run: poetry run ruff check src --exit-non-zero-on-fix |
| 25 | + - name: Ruff Format |
| 26 | + run: ruff format src --check |
7 | 27 | build-test: |
8 | 28 | runs-on: ubuntu-24.04 |
| 29 | + needs: lint |
9 | 30 | steps: |
10 | 31 | - uses: actions/checkout@v4 |
11 | | - - name: Build and publish to pypi |
12 | | - uses: JRubics/poetry-publish@v2.1 |
| 32 | + - name: Set up Python 3.13 |
| 33 | + uses: actions/setup-python@v5 |
| 34 | + with: |
| 35 | + python-version: "3.13" |
| 36 | + - name: Install Poetry |
| 37 | + run: pip install poetry |
| 38 | + - name: Update PATH |
| 39 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 40 | + - name: Build the project |
| 41 | + run: poetry build |
| 42 | + - name: Publish to Test PyPI |
| 43 | + uses: pypa/gh-action-pypi-publish@release/v1 |
13 | 44 | with: |
14 | | - pypi_token: ${{ secrets.TEST_PYPI_TOKEN }} |
15 | | - repository_name: "python-desfire" |
16 | | - repository_url: "https://test.pypi.org/legacy/" |
| 45 | + password: ${{ secrets.TEST_PYPI_TOKEN }} |
| 46 | + repository-url: https://test.pypi.org/legacy/ |
17 | 47 | release: |
18 | 48 | runs-on: ubuntu-24.04 |
| 49 | + needs: lint |
19 | 50 | environment: production |
20 | 51 | steps: |
21 | 52 | - uses: actions/checkout@v4 |
22 | | - - name: Build and publish to pypi |
23 | | - uses: JRubics/poetry-publish@v2.1 |
| 53 | + - name: Set up Python 3.13 |
| 54 | + uses: actions/setup-python@v5 |
| 55 | + with: |
| 56 | + python-version: "3.13" |
| 57 | + - name: Install Poetry |
| 58 | + run: pip install poetry |
| 59 | + - name: Update PATH |
| 60 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 61 | + - name: Build the project |
| 62 | + run: poetry build |
| 63 | + - name: Publish to Test PyPI |
| 64 | + uses: pypa/gh-action-pypi-publish@release/v1 |
24 | 65 | with: |
25 | | - pypi_token: ${{ secrets.PYPI_TOKEN }} |
26 | | - repository_name: "python-desfire" |
| 66 | + password: ${{ secrets.TEST_PYPI_TOKEN }} |
| 67 | + repository-url: https://test.pypi.org/legacy/ |
0 commit comments