Skip to content

Commit

Permalink
on push workflow
Browse files Browse the repository at this point in the history
Fix github workflows
  • Loading branch information
sr1998 committed May 11, 2024
1 parent 71af271 commit 278f6ed
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 52 deletions.
95 changes: 48 additions & 47 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
name: Bump version
# on: push
on: push
# pull_request:
# types:
# - closed

jobs:
test:
# if: github.event.pull_request.merged == true
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
- name: 'check'
python: '3.9'
toxpython: 'python3.9'
os: 'ubuntu-latest'
- name: 'py39 (ubuntu)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
os: 'ubuntu-latest'
- name: 'py39 (windows)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
os: 'windows-latest'
- name: 'py39 (macos)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'arm64'
os: 'macos-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run pytest
# test:
# # if: github.event.pull_request.merged == true
# name: ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# timeout-minutes: 10
# strategy:
# matrix:
# include:
# - name: 'check'
# python: '3.9'
# toxpython: 'python3.9'
# os: 'ubuntu-latest'
# - name: 'py39 (ubuntu)'
# python: '3.9'
# toxpython: 'python3.9'
# python_arch: 'x64'
# os: 'ubuntu-latest'
# - name: 'py39 (windows)'
# python: '3.9'
# toxpython: 'python3.9'
# python_arch: 'x64'
# os: 'windows-latest'
# - name: 'py39 (macos)'
# python: '3.9'
# toxpython: 'python3.9'
# python_arch: 'arm64'
# os: 'macos-latest'
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.pull_request.merge_commit_sha }}
# fetch-depth: '0'
# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
# - name: Install Poetry
# run: pipx install poetry || pip install poetry
# - name: Install dependencies
# run: poetry install --with dev
# - name: Run tests
# run: poetry run pytest

bump_version_and_publish:
needs: test
# needs: test
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -72,7 +72,7 @@ jobs:
if: success() # Only continue if all was successful till now
uses: anothrNick/github-tag-action@1.67.0
env:
GITHUB_TOKEN: ${{ secrets.lib_ml_tag_bump_token }}
GITHUB_TOKEN: ${{secrets.LIB_ML_PAT_CONTENT_ACCESS}}
DEFAULT_BUMP: patch
TAG_CONTEXT: branch
WITH_V: false
Expand All @@ -84,6 +84,7 @@ jobs:
if: success() # Only continue if version in files was updated
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --build -r testpypi -u __token__ -p ${{ secrets.PYPI_TEST_ACCOUNT }} --name
poetry publish --build -r testpypi -u __token__ -p ${{ secrets.PYPI_TEST_ACCOUNT }}

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
</div>

## Installation
Inside your virtual environment run:
> Python 3.9 is needed for this library!
Inside your python 3.9 virtual environment run:

```bash
poetry add package_template_tester
poetry add lib-ml-REMLA10-2024
```

or install with `pip`

```bash
pip install package_template_tester
pip install lib-ml-REMLA10-2024
```

Now you can import the library inside python modules
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ serialize = [
"{major}.{minor}.{patch}-beta.{pre_n}",
"{major}.{minor}.{patch}",
]
current_version = "(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-beta\\.(0|[1-9]\\d*))?"
regex = true
current_version = "0.0.0"
ignore_missing_version = false
tag = false
commit = true
Expand All @@ -70,6 +70,6 @@ search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "src/lib_ml/__init__.py"
filename = "src/lib_ml_remla/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'

0 comments on commit 278f6ed

Please sign in to comment.