Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
paarnes committed Nov 27, 2023
1 parent 41b1cb1 commit 5932518
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Python Package

on:
push:
branches:
- test

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel build twine
- name: Get current version from pyproject.toml
id: get_version
run: echo "::set-output name=version::$(grep -oP '(?<=version = ")[^"]*' pyproject.toml)"

- name: Increment version
id: increment_version
run: echo "::set-output name=version::$(python -c "version='${{ steps.get_version.outputs.version }}'.split('.'); version[-1] = str(int(version[-1]) + 1); print('.'.join(version))")"

- name: Update version in pyproject.toml
run: sed -i "s/version = \".*\"/version = \"${{ steps.increment_version.outputs.version }}\"/" pyproject.toml

- name: Commit changes to pyproject.toml
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add pyproject.toml
git commit -m "Bump version to ${{ steps.increment_version.outputs.version }}"
- name: Push changes to the branch
run: git push origin HEAD:${{ github.ref }}
if: github.ref == 'refs/heads/feature/vectorization'

- name: Build and upload to Test PyPI (dev branch)
if: github.ref == 'refs/heads/feature/vectorization'
run: |
python -m build
twine upload --repository testpypi dist/* --username __token__ --password ${{ secrets._TEST_PYPI_TOKEN }}

0 comments on commit 5932518

Please sign in to comment.