python-semantic-release #2
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
# https://guicommits.com/semantic-release-to-automate-versioning-and-publishing-to-pypi-with-github-actions/ | |
name: Semantic Release | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs at 00:00 UTC every day. | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: release | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }} | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Cache poetry dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
poetry config virtualenvs.create false | |
poetry install | |
- name: Python Semantic Release | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
semantic-release publish -D commit_author="github-actions <[email protected]>" | |
env: | |
GH_TOKEN: ${{secrets.SEMANTIC_RELEASE_GH_TOKEN}} | |
PyPI_TOKEN: ${{secrets.PyPI_TOKEN}} |