forked from CrossNox/m2r2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: Update relevant github actions
- Loading branch information
1 parent
4c338f2
commit 43a7803
Showing
4 changed files
with
43 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters