Skip to content

Commit

Permalink
update gha
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Dec 16, 2023
1 parent 8a3aef7 commit 1b6b8fc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
60 changes: 33 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: poetry run make html --directory docs/

Continuous-Development:
needs: Continuous-Integration
# needs: Continuous-Integration

if: github.ref == 'refs/heads/main' # github.event_name == 'push' &&

Expand All @@ -66,33 +66,39 @@ jobs:
- name: Install package
run: poetry install

- name: Use Python Semantic Release to prepare release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry run semantic-release publish
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Test install from TestPyPI
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
pycounts
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# This action uses Python Semantic Release v8
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v8.0.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: Use Python Semantic Release to prepare release
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config user.name github-actions
# git config user.email github-actions@github.com
# poetry run semantic-release publish

# - name: Publish to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/

# - name: Test install from TestPyPI
# run: |
# pip install \
# --index-url https://test.pypi.org/simple/ \
# --extra-index-url https://pypi.org/simple \
# pycounts

# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ sphinx-rtd-theme = "^1.3.0"
python-semantic-release = "^8.5.1"

[tool.semantic_release]
version_variable = "pyproject.toml:tool.poetry.version" # version location
version_variable = [
"pyproject.toml:tool.poetry.version",
]
branch = "main" # branch to make releases of
changelog_file = "CHANGELOG.md" # changelog file
build_command = "poetry build" # build dists
build_command = "pip install poetry && poetry build" # build dists
commit_version_number = true # commit version number
commit_message = "chore(release): release {version}" # commit message
dist_path = "dist/" # where to put dists
Expand Down

0 comments on commit 1b6b8fc

Please sign in to comment.