Skip to content

Commit

Permalink
Version 0.0.3 and small fixes (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau authored Jun 4, 2024
1 parent 842ddf5 commit 4250cf4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
24 changes: 19 additions & 5 deletions .github/actions/publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,23 @@ inputs:
runs:
using: composite
steps:
- name: display inputs
run: |
echo ${{ inputs.BRANCH }}
shell: bash

- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.BRANCH }}
token: ${{ inputs.ACCESS_TOKEN }}

- name: check install
run: |
git status
git branch
shell: bash

- name: Install poetry
run: pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
shell: bash
Expand All @@ -84,11 +95,14 @@ runs:

- name: Set GitHub Tag as Package Version
run: |
vname="${{ github.event.release.tag_name }}"
vname=${vname:1}
echo $vname
sed -i -r 's/__version__ *= *".*"/__version__ = "$vname" /g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
sed -i '0,/version =.*/s//version = "'"$vname"'"/' ./pyproject.toml
if ${{ inputs.UPDATE_CODE_VERSION }}
then
vname="${{ github.event.release.tag_name }}"
vname=${vname:1}
echo $vname
sed -i -r 's/__version__ *= *".*"/__version__ = "'"$vname"'" /g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
sed -i '0,/version =.*/s//version = "'"$vname"'"/' ./pyproject.toml
fi
shell: bash

- name: Add and Commit Version
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ jobs:
python-version: '3.10'

- name: Install from TestPyPI & run tests with installed package
id: install
run: |
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ choice-learn
python tests/manual_run.py
cd ../
echo ${{ github.event.release.tag_name }}
python choice-learn/tests/manual_run.py
cd choice-learn
echo "b"
git fetch --all
BRANCH=$(git branch --list -r "origin/release_*" | tr '*' ' ')
echo $BRANCH
BRANCH="${BRANCH:9}"
echo $BRANCH
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
- name: publish to PyPI
uses: ./.github/actions/publish
Expand All @@ -32,5 +43,5 @@ jobs:
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PUBLISH_REGISTRY_USER: ${{ secrets.PYPI_USERNAME }}
UPDATE_CODE_VERSION: false
BRANCH: release_${{ github.event.release.tag_name }}
BRANCH: ${{ steps.install.outputs.BRANCH }}

2 changes: 1 addition & 1 deletion choice_learn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Choice-Learn library for choice modeling in Python."""

__version__ = "0.0.2"
__version__ = "0.0.3"
__author__ = "Vincent Auriau"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pythonpath = ["./"]

[tool.poetry]
name = "choice-learn"
version = "0.0.2"
version = "0.0.3"
description = "Large-scale choice modeling through the lens of machine learning."
authors = [
"artefactory <[email protected]>",
Expand Down

0 comments on commit 4250cf4

Please sign in to comment.