Repository navigation
82 lines (76 loc) · 2.62 KB
/
Copy pathrelease.yaml
File metadata and controls
82 lines (76 loc) · 2.62 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
release:
types: [published]
permissions:
contents: read
concurrency:
group: pypi-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: '24.19.0'
- name: Require Node conformance runner
run: node --version
- name: Verify release tag matches package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PYTHON'
import os
import tomllib
from pathlib import Path
project = tomllib.loads(Path("pyproject.toml").read_text())["project"]
expected = "v" + project["version"]
if os.environ["RELEASE_TAG"] != expected:
raise SystemExit(f"Release tag must be {expected}")
PYTHON
- name: Install build tools
run: python -m pip install --upgrade build twine
- name: Build sdist and wheel from the sdist
run: python -m build
- name: Verify distribution file allowlists
run: python scripts/check_distribution_files.py
- name: Check distribution metadata
run: python -m twine check --strict dist/*
- name: Install the wheel
run: python scripts/install_distribution.py wheel
- name: Test the installed wheel
run: python -m unittest discover -s tests -v
- name: Install and test source distribution
run: |
python scripts/install_distribution.py sdist
python -m unittest discover -s tests -v
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: distributions
path: dist/
if-no-files-found: error
retention-days: 7
publish:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: pypi
url: https://pypi.org/project/Python-JavaScript/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: distributions
path: dist/
- name: Publish to PyPI using Trusted Publishing
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1