Skip to content

Commit

Permalink
Update publishing action
Browse files Browse the repository at this point in the history
  • Loading branch information
diogomatoschaves committed Feb 20, 2024
1 parent 55939b1 commit c97b579
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 110 deletions.
76 changes: 40 additions & 36 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This workflows 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

name: Upload geneal to Pypi

Expand All @@ -8,41 +6,47 @@ on:
types: [published]

jobs:
deploy:
build:
name: Build project distribution 📦
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install poetry
run: |
pipx install poetry
poetry self add poetry-bumpversion
- name: Build
run: |
poetry version ${{ github.ref_name }}
poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish stratestic 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/stratestic
permissions:
id-token: write

steps:
- uses: actions/checkout@v2
- name: Change Pypi version
run: |
python ./scripts/update_version.py
- name: Commit files
env:
CI_USER: ${{ secrets.USERNAME }}
CI_EMAIL: ${{ secrets.EMAIL }}
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git commit -a -m "Update version.txt"
- name: Push code to master
env:
CI_USER: ${{ secrets.USERNAME }}
CI_EMAIL: ${{ secrets.EMAIL }}
GITHUB_REPOSITORY: ${{ secrets.REPOSITORY }}
run: git push "https://$CI_USER:[email protected]/$GITHUB_REPOSITORY.git" HEAD:master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2020 Diogo Matos Chaves
Copyright 2024 Diogo Matos Chaves

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
Expand Down
36 changes: 6 additions & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[tool.poetry]
name = "genetic-algorithm"
version = "0.4.1"
description = "Python Genetic Algorithms library"
authors = ["Diogo Matos Chaves <[email protected]>"]
name = "geneal"
version = "0.5.1"
description = "Python Genetic Algorithm library"
license = "MIT License"
authors = ["Diogo Matos Chaves <[email protected]>"]
readme = "README.md"
repository = "https://github.com/diogomatoschaves/geneal"
keywords = ["genetic algorithms", "ga", "optimization", "genetic programming"]

[tool.poetry.dependencies]
python = ">=3.7.1,<3.11"
python = ">=3.8,<3.11"
numpy = "1.21.6"
matplotlib = "3.5.3"
numba = "0.56.2"
Expand All @@ -15,7 +18,7 @@ networkx = "2.6.3"
pandas = "1.3.5"
descartes = "1.1.0"
ipykernel = "6.16.0"
plotly = "5.10.0"
plotly = "^5.10.0"
nbformat = "5.6.1"

[tool.poetry.dev-dependencies]
Expand Down
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

32 changes: 0 additions & 32 deletions setup.py

This file was deleted.

0 comments on commit c97b579

Please sign in to comment.