Skip to content

Commit

Permalink
FEAT: Update relevant github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Jan 12, 2024
1 parent 4c338f2 commit 43a7803
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 90 deletions.
80 changes: 22 additions & 58 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,37 @@
name: Deploy to pypi
name: "m2r3-release"

permissions:
contents: write

on:
push:
branches: master
tags:
- 'v*.*.*'

jobs:
untagged_deploy:
github-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
- uses: actions/checkout@master
- name: Release
uses: softprops/action-gh-release@v1
with:
python-version: 3.7
- name: Install dependencies
run: pip install wheel
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_token }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
tagged_deploy:
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pypi-release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: actions/setup-python@v2
- name: Install dependencies
run: pip install wheel
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
skip_existing: true
- name: Update docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
- name: Create artifact
uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: docs/_build/html/
- name: Commit documentation changes
run: |
git clone https://github.com/crossnox/m2r2.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation ${{ github.ref }}" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GH_TOKEN }}
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
python -m twine upload --repository pypi dist/*
28 changes: 17 additions & 11 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install nox
run: pip install nox
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Run cop session
run: nox --sessions cop
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x # Replace 'x' with your desired Python version

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
export PATH="$HOME/.local/bin:$PATH"
- name: Install project dependencies (including dev)
run: poetry install

- name: Run linters and formatters
run: poetry run pre-commit run --all-files
23 changes: 3 additions & 20 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ the original readme, changing only what's needed to work with `m2r2`.

- IMPORTANT NOTE: it doesn't fully work, it just mostly works and I intend to keep adding any PRs that come my way. Not all the old functionality is there, but it's mostly there and builds.
- Updated packaging to poetry, because it was a big pain to reproduce the original package development and this way it's easier to have a reproducible working environment.
- Works with the latest sphinx versions and mistune v2
- Update python to the present, works with the latest sphinx versions and mistune v2.

## Why another converter?

Expand Down

0 comments on commit 43a7803

Please sign in to comment.