-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.56 KB
/
Copy pathrelease.yaml
File metadata and controls
59 lines (49 loc) · 1.56 KB
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
name: Publish release
on:
release:
types: [published]
jobs:
build-and-publish-pypi:
name: Build and publish release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment:
name: valetudo_map_parser_pypi
steps:
# Step 1: Checkout the repository
- uses: actions/checkout@v6
# Step 2: Set up Python
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
# Step 3: Install Poetry
- name: Install Poetry
run: pip install poetry
# Step 4: Install Dependencies
- name: Install dependencies
run: poetry install --no-interaction
# Step 5: Set the Package Version
- name: Set package version
run: |
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
poetry version --no-interaction "${version}"
# Step 6: Ensure All Folders Are Packaged
- name: Verify package inclusion
run: |
echo "Checking project structure..."
tree SCR # Optional: Display structure for debugging
touch SCR/__init__.py # Ensure SCR is treated as a package
# Step 7: Build the Package
- name: Build package
run: poetry build --no-interaction
# Step 8: Publish to PyPI
- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: dist/