Skip to content

Commit

Permalink
Merge pull request #44 from ocefpaf/pypi
Browse files Browse the repository at this point in the history
Add PyPI autopublish
  • Loading branch information
ocefpaf authored Oct 19, 2023
2 parents 4f4e68a + 83055b6 commit 90e361f
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish to PyPI

on:
pull_request:
push:
branches:
- main
release:
types:
- published

defaults:
run:
shell: bash

jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install build tools
run: |
python -m pip install --upgrade build
- name: Build sdist and binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
python -m pip install --upgrade check-manifest
check-manifest --verbose
- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m pip install --upgrade twine
python -m twine check *
- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include *.txt
include README.md
include pyproject.toml

include cc_plugin_glider/tests/data/gliders/*.cdl
include cc_plugin_glider/tests/data/gliders/*.xml
recursive-include cc_plugin_glider *.cdl
recursive-include cc_plugin_glider *.xml

prune .github
prune *.egg-info
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ requires = [
"wheel",
]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project]
name = "cc-plugin-glider"
description = "Compliance Checker Glider DAC plugin"
Expand All @@ -25,13 +29,13 @@ dynamic = [
"dependencies",
"version",
]

[project.urls]
documentation = "http://ioos.github.io/compliance-checker/"
homepage = "https://github.com/ioos/cc-plugin-glider"
repository = "https://github.com/ioos/cc-plugin-glider"
[project.entry-points."compliance_checker.suites"]
"gliderdac" = "cc_plugin_glider.glider_dac:GliderCheck"

[tool.setuptools]
packages = ["cc_plugin_glider"]
include-package-data = true
Expand Down

0 comments on commit 90e361f

Please sign in to comment.