-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.71 KB
/
release.yml
File metadata and controls
60 lines (55 loc) · 1.71 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
60
name: release-python
on:
push:
tags:
- "v*"
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/justserpapi/
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install release dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
pip install .
- name: Verify tag and package version
run: python scripts/sdkctl.py verify-release --tag "${GITHUB_REF_NAME}"
- name: Validate docs
run: python scripts/sdkctl.py validate-examples
- name: Run tests
run: python -m unittest discover -s tests -v
- name: Build distribution artifacts
run: python -m build
- name: Check distribution metadata
run: python -m twine check dist/*
- name: Smoke install built wheel
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: |
python -m venv .release-venv
. .release-venv/bin/activate
pip install dist/*.whl
python - <<'PY'
import os
import justserpapi
expected = os.environ["RELEASE_VERSION"].removeprefix("v")
assert justserpapi.__version__ == expected
client = justserpapi.Client(api_key="test-api-key")
assert type(client).__name__ == "Client"
assert type(client.google).__name__ == "GoogleResource"
client.close()
PY
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1