From 5408bf930cf3418fdf11549547d3f16c976d8267 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Sun, 11 Jun 2023 00:25:41 +0200 Subject: [PATCH 1/4] add github workflow for publishing to pypi --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1c9f2e0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish to PyPI + +on: push + +jobs: + publish: + name: Publish ${{ matrix.package }} + runs-on: ubuntu-latest + strategy: + matrix: + package: [docker-run, docker-run-docker-ros] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: python3 -m pip install --user build + - name: Build wheel and tarball + run: python3 -m build --sdist --wheel --outdir dist/ ${{ matrix.package }} + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@v1.8.6 + with: + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@v1.8.6 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 5d4bf9f44be1424717aad919a323a5376ca17d0a Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Sun, 11 Jun 2023 00:25:49 +0200 Subject: [PATCH 2/4] add pypi version badge to readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6961563..6a61884 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ # *docker-run* – ``docker run`` and ``docker exec`` with useful defaults

- - + +

*docker-run* is a CLI tool for simplified interaction with Docker images. Use it to easily start and attach to Docker containers with useful predefined arguments. From c6dadb88a5756aaceb9fd785f59abb47409dc2ec Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Sun, 11 Jun 2023 00:30:10 +0200 Subject: [PATCH 3/4] rename top-level folder to match pypi package name --- .github/workflows/publish.yml | 2 +- {docker-run => docker-run-cli}/LICENSE | 0 {docker-run => docker-run-cli}/MANIFEST.in | 0 {docker-run => docker-run-cli}/README.md | 0 {docker-run => docker-run-cli}/pyproject.toml | 0 .../scripts/activate-python-docker-run-shell-completion | 0 {docker-run => docker-run-cli}/scripts/docker-run | 0 {docker-run => docker-run-cli}/src/docker_run/__init__.py | 0 {docker-run => docker-run-cli}/src/docker_run/__main__.py | 0 .../src/docker_run/bash_completion.d/docker-run | 0 {docker-run => docker-run-cli}/src/docker_run/core.py | 0 .../src/docker_run/plugins/__init__.py | 0 {docker-run => docker-run-cli}/src/docker_run/plugins/core.py | 0 {docker-run => docker-run-cli}/src/docker_run/plugins/plugin.py | 0 {docker-run => docker-run-cli}/src/docker_run/utils.py | 0 15 files changed, 1 insertion(+), 1 deletion(-) rename {docker-run => docker-run-cli}/LICENSE (100%) rename {docker-run => docker-run-cli}/MANIFEST.in (100%) rename {docker-run => docker-run-cli}/README.md (100%) rename {docker-run => docker-run-cli}/pyproject.toml (100%) rename {docker-run => docker-run-cli}/scripts/activate-python-docker-run-shell-completion (100%) rename {docker-run => docker-run-cli}/scripts/docker-run (100%) rename {docker-run => docker-run-cli}/src/docker_run/__init__.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/__main__.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/bash_completion.d/docker-run (100%) rename {docker-run => docker-run-cli}/src/docker_run/core.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/plugins/__init__.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/plugins/core.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/plugins/plugin.py (100%) rename {docker-run => docker-run-cli}/src/docker_run/utils.py (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1c9f2e0..ce90611 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - package: [docker-run, docker-run-docker-ros] + package: [docker-run-cli, docker-run-docker-ros] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/docker-run/LICENSE b/docker-run-cli/LICENSE similarity index 100% rename from docker-run/LICENSE rename to docker-run-cli/LICENSE diff --git a/docker-run/MANIFEST.in b/docker-run-cli/MANIFEST.in similarity index 100% rename from docker-run/MANIFEST.in rename to docker-run-cli/MANIFEST.in diff --git a/docker-run/README.md b/docker-run-cli/README.md similarity index 100% rename from docker-run/README.md rename to docker-run-cli/README.md diff --git a/docker-run/pyproject.toml b/docker-run-cli/pyproject.toml similarity index 100% rename from docker-run/pyproject.toml rename to docker-run-cli/pyproject.toml diff --git a/docker-run/scripts/activate-python-docker-run-shell-completion b/docker-run-cli/scripts/activate-python-docker-run-shell-completion similarity index 100% rename from docker-run/scripts/activate-python-docker-run-shell-completion rename to docker-run-cli/scripts/activate-python-docker-run-shell-completion diff --git a/docker-run/scripts/docker-run b/docker-run-cli/scripts/docker-run similarity index 100% rename from docker-run/scripts/docker-run rename to docker-run-cli/scripts/docker-run diff --git a/docker-run/src/docker_run/__init__.py b/docker-run-cli/src/docker_run/__init__.py similarity index 100% rename from docker-run/src/docker_run/__init__.py rename to docker-run-cli/src/docker_run/__init__.py diff --git a/docker-run/src/docker_run/__main__.py b/docker-run-cli/src/docker_run/__main__.py similarity index 100% rename from docker-run/src/docker_run/__main__.py rename to docker-run-cli/src/docker_run/__main__.py diff --git a/docker-run/src/docker_run/bash_completion.d/docker-run b/docker-run-cli/src/docker_run/bash_completion.d/docker-run similarity index 100% rename from docker-run/src/docker_run/bash_completion.d/docker-run rename to docker-run-cli/src/docker_run/bash_completion.d/docker-run diff --git a/docker-run/src/docker_run/core.py b/docker-run-cli/src/docker_run/core.py similarity index 100% rename from docker-run/src/docker_run/core.py rename to docker-run-cli/src/docker_run/core.py diff --git a/docker-run/src/docker_run/plugins/__init__.py b/docker-run-cli/src/docker_run/plugins/__init__.py similarity index 100% rename from docker-run/src/docker_run/plugins/__init__.py rename to docker-run-cli/src/docker_run/plugins/__init__.py diff --git a/docker-run/src/docker_run/plugins/core.py b/docker-run-cli/src/docker_run/plugins/core.py similarity index 100% rename from docker-run/src/docker_run/plugins/core.py rename to docker-run-cli/src/docker_run/plugins/core.py diff --git a/docker-run/src/docker_run/plugins/plugin.py b/docker-run-cli/src/docker_run/plugins/plugin.py similarity index 100% rename from docker-run/src/docker_run/plugins/plugin.py rename to docker-run-cli/src/docker_run/plugins/plugin.py diff --git a/docker-run/src/docker_run/utils.py b/docker-run-cli/src/docker_run/utils.py similarity index 100% rename from docker-run/src/docker_run/utils.py rename to docker-run-cli/src/docker_run/utils.py From 1178c47c8ffb9bc0f1a92b31774aa1a16036acca Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Sun, 11 Jun 2023 00:38:46 +0200 Subject: [PATCH 4/4] dont fail ci on existing packages on testpypi --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ce90611..b55b74a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,8 +23,9 @@ jobs: - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@v1.8.6 with: - repository-url: https://test.pypi.org/legacy/ password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + skip-existing: true - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@v1.8.6