Skip to content

Commit 4f80b14

Browse files
committed
publish docs on push to main
1 parent 3acb29c commit 4f80b14

File tree

3 files changed

+40
-31
lines changed

3 files changed

+40
-31
lines changed

.github/workflows/release.yml renamed to .github/workflows/deploy-docs.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
11
# This workflows will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

4-
name: Release
4+
name: Deploy Documentation
55

66
on:
7-
release:
8-
types:
9-
- created
7+
push:
8+
branches:
9+
- "main"
10+
tags:
11+
- "*"
1012

1113
jobs:
12-
publish-package:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Set up Python
17-
uses: actions/setup-python@v1
18-
with:
19-
python-version: "3.x"
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24-
- name: Build and publish
25-
env:
26-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28-
run: |
29-
python setup.py bdist_wheel
30-
twine upload dist/*
3114
deploy-documentation:
32-
needs: [publish-package]
3315
runs-on: ubuntu-latest
3416
steps:
3517
- uses: actions/checkout@v2

.github/workflows/release-pkg.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Release Package
5+
6+
on:
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
release-package:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: "3.x"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel twine
24+
- name: Build and publish
25+
env:
26+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28+
run: |
29+
python setup.py bdist_wheel
30+
twine upload dist/*

docs/source/conf.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import sys
1010
from pathlib import Path
11-
from setuptools_scm import version_from_scm
11+
from pkg_resources import get_distribution
1212

1313
# -- Path Setup --------------------------------------------------------------
1414

@@ -27,12 +27,9 @@
2727
copyright = "2019, Ryan Morshead"
2828
author = "Ryan Morshead"
2929

30-
import idom # noqa
31-
32-
print(str(here.parent))
33-
_scm_version = version_from_scm(str(here.parent.parent))
34-
release = _scm_version.tag.base_version
35-
version = release.rsplit(".", 1)[0]
30+
release = get_distribution("idom").version
31+
# for example take major/minor
32+
version = ".".join(release.split(".")[:2])
3633

3734
# -- General configuration ---------------------------------------------------
3835

0 commit comments

Comments
 (0)