Skip to content

Commit 86c927c

Browse files
authored
Merge pull request #1658 from qilingframework/dev
Dev
2 parents 97bfe03 + d19bf18 commit 86c927c

52 files changed

Lines changed: 2560 additions & 813 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,73 @@
11
name: PyPI 📦 Distribution
22

3-
on: [push]
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
47

58
jobs:
69
build:
710
runs-on: ubuntu-latest
811
steps:
9-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v6
1013
- name: Set up Python
11-
uses: actions/setup-python@v4
14+
uses: actions/setup-python@v6
1215
with:
13-
python-version: "^3.8"
16+
python-version: "3.13"
1417
- name: Install dependencies
15-
run: pipx install poetry
18+
run: python -m pip install "poetry>=2,<3" build twine
19+
- name: Check package metadata
20+
run: poetry check --lock
21+
- name: Check release tag matches package version
22+
if: startsWith(github.ref, 'refs/tags/')
23+
env:
24+
RELEASE_TAG: ${{ github.ref_name }}
25+
run: |
26+
python - <<'PY'
27+
import os
28+
import tomllib
29+
from pathlib import Path
30+
from packaging.version import Version
31+
32+
tag = os.environ['RELEASE_TAG'].removeprefix('v')
33+
version = tomllib.loads(Path('pyproject.toml').read_text())['tool']['poetry']['version']
34+
if Version(tag) != Version(version):
35+
raise SystemExit(f'Release tag {tag!r} does not match package version {version!r}')
36+
PY
1637
- name: Build distribution 📦
17-
run: poetry build -n
38+
run: python -m build
39+
- name: Check distribution metadata
40+
run: python -m twine check --strict dist/*
41+
- name: Test installed wheel
42+
run: |
43+
python -m pip install dist/*.whl
44+
python -I tests/test_qltool.py InstalledQltool_Test -v
1845
- uses: actions/upload-artifact@v4
1946
with:
47+
name: distributions
2048
path: ${{ github.workspace }}/dist/*
49+
if-no-files-found: error
2150

2251
publish:
2352
needs: [build]
2453
runs-on: ubuntu-latest
25-
if: startsWith(github.ref, 'refs/tags')
54+
if: startsWith(github.ref, 'refs/tags/')
2655
steps:
2756
- uses: actions/download-artifact@v4
2857
with:
29-
name: artifact
58+
name: distributions
3059
path: dist
3160

3261
- name: Publish distribution 📦 to test PyPI
33-
uses: pypa/gh-action-pypi-publish@master
62+
uses: pypa/gh-action-pypi-publish@release/v1
3463
with:
3564
user: __token__
3665
password: ${{ secrets.testpypi_pass }}
37-
repository_url: https://test.pypi.org/legacy/
66+
repository-url: https://test.pypi.org/legacy/
67+
skip-existing: true
3868

3969
- name: Publish distribution 📦 to PyPI
40-
if: ${{ success() }}
41-
uses: pypa/gh-action-pypi-publish@master
70+
uses: pypa/gh-action-pypi-publish@release/v1
4271
with:
4372
user: __token__
4473
password: ${{ secrets.pypi_pass }}

AGENT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ARCHITECTURE.md

0 commit comments

Comments
 (0)