Skip to content

Commit f8ff68f

Browse files
author
Daniel Herrmann
committed
ci: add linting to github actions and refactor build to not install all dependencies
1 parent a1fc6bd commit f8ff68f

1 file changed

Lines changed: 50 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,64 @@ on:
44
tags:
55
- "v*.*.*"
66
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
727
build-test:
828
runs-on: ubuntu-24.04
29+
needs: lint
930
steps:
1031
- 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
1344
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/
1747
release:
1848
runs-on: ubuntu-24.04
49+
needs: lint
1950
environment: production
2051
steps:
2152
- 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
2465
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

Comments
 (0)