Skip to content

ci: add tests matrix #19

ci: add tests matrix

ci: add tests matrix #19

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
push:
branches: [ main, dev ]
workflow_dispatch:
jobs:
tests:
name: πŸ§ͺ Running Tests
uses: ./.github/workflows/tests.yml
tags:
name: 🏷️ Update Tags
runs-on: ubuntu-latest
needs: tests
outputs:
new_version: ${{ steps.tag.outputs.new_version }}
steps:
- uses: actions/checkout@v3
name: πŸ›ŽοΈ Checkout
- name: ⏫ Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pre_release_branches: "dev"
- name: ✍️ Add tag to output step
id: tag
run: echo "::set-output name=new_version::${{ steps.tag_version.outputs.new_version }}"
deploy:
name: πŸš€ Publish
runs-on: ubuntu-latest
needs: tags
steps:
- uses: actions/checkout@v3
name: πŸ›ŽοΈ Checkout
- name: 🐍 Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: ⛓️ Install dependencies
run: python -m pip install --upgrade pip build twine
- name: Bump version
run: sed -i 's/__version__ = "0.0.0"/__version__ = "${{ needs.tags.outputs.new_version }}"/g' src/splitter/__init__.py
- name: πŸ”¨ Build package
run: python -m build
- name: πŸš€ Publish Package
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload -u __token__ dist/*