Skip to content

Commit

Permalink
ci: use release please (#102)
Browse files Browse the repository at this point in the history
* move __version__ to version.py

* replace release action with release-please
  • Loading branch information
leo-desbureaux-tellae authored Dec 9, 2024
1 parent e68de77 commit 14a3e9e
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 81 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Create release
id: release
uses: googleapis/release-please-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python

- name: Checkout repository
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v2
- name: Set up Python
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install pypa/build
if: ${{ steps.release.outputs.release_created }}
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
if: ${{ steps.release.outputs.release_created }}
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: ${{ steps.release.outputs.release_created }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
74 changes: 0 additions & 74 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Tellae"

# Get the version from the version module
version_module = importlib.import_module("starling_sim.__init__")
version_module = importlib.import_module("starling_sim.version")
version = ".".join(version_module.__version__.split(".")[0:2])

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import setuptools
import os
from starling_sim import __version__
from starling_sim.version import __version__

# short description of the project
DESC = "Agent-based framework for mobility simulation"
Expand Down
3 changes: 0 additions & 3 deletions starling_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
This package contains the different modules of Starling.
"""

#: Starling version
__version__ = "0.11.5"
2 changes: 1 addition & 1 deletion starling_sim/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from starling_sim.utils.data_tree import create_data_tree, import_examples
from starling_sim.utils.simulation_logging import DEFAULT_LOGGER_LEVEL, setup_logging
from starling_sim.utils import paths
from starling_sim import __version__
from starling_sim.version import __version__


def run_main():
Expand Down
2 changes: 1 addition & 1 deletion starling_sim/simulation_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from starling_sim.utils.utils import json_load, add_defaults_and_validate
from starling_sim.utils import paths
from starling_sim.utils.config import config
from starling_sim import __version__
from starling_sim.version import __version__


class SimulationScenario:
Expand Down
2 changes: 2 additions & 0 deletions starling_sim/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#: Starling version
__version__ = "0.11.5"

0 comments on commit 14a3e9e

Please sign in to comment.