diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index be6458ee..8014f36f 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,17 +1,11 @@ -name: Create and publish a Docker image +name: Publish a pypi package on: - push: - branches: ['release'] - tags: - - '*' - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + release: + types: [created] jobs: - build-and-push-image: + publish_to_pypi: runs-on: ubuntu-latest permissions: contents: read @@ -19,34 +13,23 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to the Container repository - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + uses: actions/checkout@v4 - - name: Build and push Docker image - uses: docker/build-push-action@v5 + - name: Set up Python + uses: actions/setup-python@v2 with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build and publish package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + pipx run build + pipx run twine check dist/* + python -m twine upload --repository pypi dist/* \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0e0ad15..c2dfb4f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' - cache: 'pip' # caching pip dependencies + cache: 'pip' - run: pip install -r requirements.txt diff --git a/pyproject.toml b/pyproject.toml index c099a621..4dff05e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["flit_core >=3.2,<4", "musica"] build-backend = "flit_core.buildapi" [project] -name = "music_box" +name = "acom_music_box" authors = [{name = "NCAR/ACOM", email = "musica-support@ucar.edu"}] readme = "README.md" license = {file = "LICENSE"} diff --git a/requirements.txt b/requirements.txt index 842abc11..18a2e127 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ musica pandas -pytest \ No newline at end of file +pipx +pytest +twine \ No newline at end of file diff --git a/src/music_box/__init__.py b/src/acom_music_box/__init__.py similarity index 100% rename from src/music_box/__init__.py rename to src/acom_music_box/__init__.py diff --git a/src/music_box/music_box.py b/src/acom_music_box/music_box.py similarity index 100% rename from src/music_box/music_box.py rename to src/acom_music_box/music_box.py diff --git a/src/music_box/music_box_conditions.py b/src/acom_music_box/music_box_conditions.py similarity index 100% rename from src/music_box/music_box_conditions.py rename to src/acom_music_box/music_box_conditions.py diff --git a/src/music_box/music_box_evolving_conditions.py b/src/acom_music_box/music_box_evolving_conditions.py similarity index 100% rename from src/music_box/music_box_evolving_conditions.py rename to src/acom_music_box/music_box_evolving_conditions.py diff --git a/src/music_box/music_box_model_options.py b/src/acom_music_box/music_box_model_options.py similarity index 100% rename from src/music_box/music_box_model_options.py rename to src/acom_music_box/music_box_model_options.py diff --git a/src/music_box/music_box_product.py b/src/acom_music_box/music_box_product.py similarity index 100% rename from src/music_box/music_box_product.py rename to src/acom_music_box/music_box_product.py diff --git a/src/music_box/music_box_reactant.py b/src/acom_music_box/music_box_reactant.py similarity index 100% rename from src/music_box/music_box_reactant.py rename to src/acom_music_box/music_box_reactant.py diff --git a/src/music_box/music_box_reaction.py b/src/acom_music_box/music_box_reaction.py similarity index 100% rename from src/music_box/music_box_reaction.py rename to src/acom_music_box/music_box_reaction.py diff --git a/src/music_box/music_box_reaction_list.py b/src/acom_music_box/music_box_reaction_list.py similarity index 100% rename from src/music_box/music_box_reaction_list.py rename to src/acom_music_box/music_box_reaction_list.py diff --git a/src/music_box/music_box_reaction_rate.py b/src/acom_music_box/music_box_reaction_rate.py similarity index 100% rename from src/music_box/music_box_reaction_rate.py rename to src/acom_music_box/music_box_reaction_rate.py diff --git a/src/music_box/music_box_species.py b/src/acom_music_box/music_box_species.py similarity index 100% rename from src/music_box/music_box_species.py rename to src/acom_music_box/music_box_species.py diff --git a/src/music_box/music_box_species_concentration.py b/src/acom_music_box/music_box_species_concentration.py similarity index 100% rename from src/music_box/music_box_species_concentration.py rename to src/acom_music_box/music_box_species_concentration.py diff --git a/src/music_box/music_box_species_list.py b/src/acom_music_box/music_box_species_list.py similarity index 100% rename from src/music_box/music_box_species_list.py rename to src/acom_music_box/music_box_species_list.py diff --git a/src/music_box/utils.py b/src/acom_music_box/utils.py similarity index 100% rename from src/music_box/utils.py rename to src/acom_music_box/utils.py diff --git a/tests/test_analytical.py b/tests/test_analytical.py index a875c9ee..46dbdb86 100644 --- a/tests/test_analytical.py +++ b/tests/test_analytical.py @@ -1,5 +1,5 @@ -from music_box import MusicBox +from acom_music_box import MusicBox import math diff --git a/tests/test_chapman.py b/tests/test_chapman.py index 21cd611f..c7debd66 100644 --- a/tests/test_chapman.py +++ b/tests/test_chapman.py @@ -1,4 +1,4 @@ -from music_box import MusicBox +from acom_music_box import MusicBox import csv import math diff --git a/tests/test_wall_loss.py b/tests/test_wall_loss.py index c16ee889..4c2d7322 100644 --- a/tests/test_wall_loss.py +++ b/tests/test_wall_loss.py @@ -1,4 +1,4 @@ -from music_box import MusicBox +from acom_music_box import MusicBox import csv import math