Skip to content

Bumping requirements and version #17

Bumping requirements and version

Bumping requirements and version #17

Workflow file for this run

# SPDX-FileCopyrightText: 2021 - 2023 Mewbot Developers <[email protected]>
#
# SPDX-License-Identifier: BSD-2-Clause
name: Publish to PyPI
on:
push:
branches:
- main
jobs:
publish:
name: Publish Packages
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Python ${{ vars.DEFAULT_PYTHON }}
uses: actions/setup-python@v4
with:
python-version: ${{ vars.DEFAULT_PYTHON }}
cache: pip
cache-dependency-path: |
requirements.txt
- name: Install dependencies
run: pip install build --user
- name: Create Version
shell: bash
run: |
VERSION="$(git describe --tags)" # <tag version>-<+n>-<hash>
VERSION="${VERSION%-*}" # <tag version>-<+n>
VERSION="${VERSION%-*}.dev${VERSION##*-}" # <tag version>.dev<+n>
printf "RELEASE_VERSION=%s\n" "$VERSION" >>"$GITHUB_ENV"
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Archive installation artifacts
uses: actions/upload-artifact@v3
with:
name: builds
path: dist
- name: Publish distribution packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}