-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.21 KB
/
publish.yml
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
name: publish
on:
push:
tags:
- "*.*.*"
permissions:
contents: read
id-token: write
jobs:
build_and_publish_pypi:
if: github.repository_owner == 'statnett'
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: install poetry
run: |
python -m pip install --upgrade pip wheel pipx
python -m pipx install poetry
- name: Install dependencies
run: |
poetry install
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Run tests and linting
run: |
poetry run pytest
poetry run ruff check
poetry run ruff format
- name: Build package
run: |
poetry build
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1