Skip to content

Commit

Permalink
Convert to pyproject. trusted release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Oct 29, 2023
1 parent 4308034 commit d75688a
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 74 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: build

on:
push:
branches: [ main ]
branches:
- main
- 'dev/**'
pull_request:
branches: [ main ]
release:
types:
- published

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


jobs:
lint:
Expand All @@ -18,7 +23,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"

- name: Install dependencies
run: |
Expand All @@ -33,32 +38,41 @@ jobs:
pylint --rcfile test/pylint.rc peakrdl_html
#-------------------------------------------------------------------------------
build_sdist:
build:
needs:
- lint
name: Build source distribution
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: 3.8
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install -U build
- name: Build sdist
run: python setup.py sdist
- name: Build
run: python -m build

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
path: |
dist/*.tar.gz
dist/*.whl
#-------------------------------------------------------------------------------
deploy:
needs:
- build_sdist
- build

runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

# Only publish when a GitHub Release is created.
if: github.event_name == 'release'
Expand All @@ -69,6 +83,3 @@ jobs:
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "peakrdl-html"
dynamic = ["version"]
requires-python = ">=3.5"
dependencies = [
"systemrdl-compiler >= 1.13.0, < 2",
"Jinja2>=2.9",
"markdown",
"git-me-the-url>=2.0.3",
"python-markdown-math",
]

authors = [
{name="Alex Mykyta"},
]
description = "HTML documentation generator for SystemRDL-based register models"
readme = "README.md"
license = {file = "LICENSE"}
keywords = [
"SystmRDL", "PeakRDL", "CSR", "compiler", "tool", "registers", "generator",
"HTML", "documentation",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Topic :: Software Development :: Documentation",
]

[project.urls]
Source = "https://github.com/SystemRDL/PeakRDL-html"
Tracker = "https://github.com/SystemRDL/PeakRDL-html/issues"
Changelog = "https://github.com/SystemRDL/PeakRDL-html/releases"

[tool.setuptools.dynamic]
version = {attr = "peakrdl_html.__about__.__version__"}

[project.entry-points."peakrdl.exporters"]
html = "peakrdl_html.__peakrdl__:Exporter"
62 changes: 0 additions & 62 deletions setup.py

This file was deleted.

0 comments on commit d75688a

Please sign in to comment.