Skip to content

Commit

Permalink
Update publish (pypi + pages) workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leifwar committed Jun 28, 2023
1 parent b238442 commit 25aa850
Show file tree
Hide file tree
Showing 8 changed files with 328 additions and 73 deletions.
90 changes: 73 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,92 @@ on:
release:
types: [created]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false


jobs:
Deploying:
build_and_publish_pypi:
runs-on: ubuntu-latest

if: github.repository_owner == 'statnett'
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Get full python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Install and configure Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.5.1

- name: Install dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: build package
run: |
poetry build
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

build_docs:
needs: build_and_publish_pypi
runs-on: ubuntu-latest
if: github.repository_owner == 'statnett'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install and configure Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.5.1
- name: Install dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
shell: bash
run: poetry install

- name: Build and publish to PyPI
- name: install dependencies
run: |
poetry config pypi-token.pypi ${{ secrets.pypi_push_token }}
poetry publish --build
poetry install --with docs
- name: build docs
run: |
poetry run sphinx docs html
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: html

# Deployment job
deploy_docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build_docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
7 changes: 0 additions & 7 deletions docs/cimsparql.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
CimSparql package
=================

.. inheritance-diagram:: cimsparql.graphdb.GraphDBClient
:top-classes: cimsparql.url.Prefix

.. toctree::
:caption: Submodules

submodules/model

submodules/graphdb

submodules/queries

submodules/type_mapper

submodules/url

submodules/parse_xml
3 changes: 0 additions & 3 deletions docs/submodules/graphdb.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
GraphDB
=======

.. inheritance-diagram:: cimsparql.graphdb.GraphDBClient
:top-classes: cimsparql.url.Model

The graphdb.GraphDBClient class is used to query GraphDB using
functions defined in model.Model.

Expand Down
4 changes: 0 additions & 4 deletions docs/submodules/model.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Model
=====

.. inheritance-diagram:: cimsparql.model.SingleClientModel
:top-classes: cimsparql.url.Prefix


The cimsparql.model module contains the base class SingleClientModel for both
:doc:`graphdb.GraphDBClient <graphdb>` get_table as well as a set of
predefined CIM queries.
Expand Down
10 changes: 0 additions & 10 deletions docs/submodules/parse_xml.rst

This file was deleted.

31 changes: 0 additions & 31 deletions docs/submodules/queries.rst

This file was deleted.

Loading

0 comments on commit 25aa850

Please sign in to comment.