From 639236d773278a01425f2a485c5f7795218708c1 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Tue, 15 Apr 2025 22:32:47 -0700 Subject: [PATCH 01/18] auto publish pypi testing --- .github/workflows/publish-to-pypi.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..44f6e6e --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,40 @@ +name: Publish Python 🐍 Package to PyPI + +on: + push: + tags: + - 'v0.0.8' # e.g., v1.2.3 + +jobs: + publish: + name: Build and Publish to PyPI + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Extract version from tag and update VERSION.txt + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/v}" + echo "$TAG_VERSION" > src/jplslim/VERSION.txt + echo "Updated src/jplslim/VERSION.txt to $TAG_VERSION" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build wheel twine + + - name: Build package + run: python -m build . + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/* From 1511f22f9501741ea72cc214360307e54fa9ec0b Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Tue, 15 Apr 2025 22:38:20 -0700 Subject: [PATCH 02/18] file path fix --- .github/workflows/publish-to-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 44f6e6e..cd1a84a 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -22,8 +22,8 @@ jobs: - name: Extract version from tag and update VERSION.txt run: | TAG_VERSION="${GITHUB_REF#refs/tags/v}" - echo "$TAG_VERSION" > src/jplslim/VERSION.txt - echo "Updated src/jplslim/VERSION.txt to $TAG_VERSION" + echo "$TAG_VERSION" > src/jpl/slim/VERSION.txt + echo "Updated src/jpl/slim/VERSION.txt to $TAG_VERSION" - name: Install build tools run: | From 7d6248e9a4652bc347c875d609aaa74427dd2c4d Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Tue, 15 Apr 2025 22:47:11 -0700 Subject: [PATCH 03/18] Pypi publishing steps revised --- README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 51f4bfe..c0c5c47 100644 --- a/README.md +++ b/README.md @@ -407,14 +407,31 @@ pytest -v -s ### Publishing a New Version -To publish a new version of SLIM CLI to the Python Package Index, typically you'll update the `VERSION.txt` file; then do: +To publish a new version of SLIM CLI to the Python Package Index, follow these steps: + +1. Create a Git tag for the new version: + ```bash + # Create the tag (use the appropriate version number) + git tag v0.1.0 + + # Push the tag to the repository + git push origin v0.1.0 + ``` + +2. The GitHub Actions workflow will automatically: + - Extract the version from the tag + - Update the version file + - Build the package + - Publish it to PyPI + +If you need to remove a tag (e.g., if there was an issue): ```bash -pip install build wheel twine -python3 -m build . -twine upload dist/* -``` +# Remove the tag locally +git tag -d v0.1.0 -(Note: this can and should eventually be automated with GitHub Actions.) +# Remove the tag from the remote repository +git push --delete origin v0.1.0 +``` ## License From 61a0d28ff648ac73d0c37ce4f59f873d596d6e45 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Sun, 27 Apr 2025 07:36:33 -0700 Subject: [PATCH 04/18] fix: semantic release workflow --- .github/workflows/publish-to-pypi.yml | 85 +++++++++++++++++++++----- .github/workflows/semantic-release.yml | 35 +++++++++++ README.md | 73 ++++++++++++++++------ pyproject.toml | 11 +++- 4 files changed, 167 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/semantic-release.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index cd1a84a..84d89d7 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,31 +1,58 @@ -name: Publish Python 🐍 Package to PyPI +name: Semantic Release and PyPI Publish on: push: - tags: - - 'v0.0.8' # e.g., v1.2.3 + branches: + - main jobs: - publish: - name: Build and Publish to PyPI + semantic-release: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install python-semantic-release build wheel - - name: Extract version from tag and update VERSION.txt + - name: Configure Git run: | - TAG_VERSION="${GITHUB_REF#refs/tags/v}" - echo "$TAG_VERSION" > src/jpl/slim/VERSION.txt - echo "Updated src/jpl/slim/VERSION.txt to $TAG_VERSION" + git config --global user.name "github-actions" + git config --global user.email "action@github.com" - - name: Install build tools + - name: Semantic Release + run: | + semantic-release version + semantic-release publish + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build: + needs: semantic-release + if: needs.semantic-release.outputs.new_release_published == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main # Ensure we get the latest commit with version update + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Upgrade tooling run: | python -m pip install --upgrade pip pip install build wheel twine @@ -33,8 +60,34 @@ jobs: - name: Build package run: python -m build . + - name: Verify package + run: twine check dist/* + + - name: Store package + uses: actions/upload-artifact@v4 + with: + name: python-package-distribution + path: | + dist/*.whl + dist/*.tar.gz + if-no-files-found: error + + publish: + runs-on: ubuntu-latest + needs: build + environment: + name: release + permissions: + id-token: write # mandatory for trusted publishing + steps: + - name: Retrieve package + uses: actions/download-artifact@v4 + with: + name: python-package-distribution + path: dist/ + - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: twine upload dist/* + uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true + repository-url: https://upload.pypi.org/legacy/ \ No newline at end of file diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 0000000..0d29df4 --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,35 @@ +name: Semantic Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install python-semantic-release build wheel + + - name: Configure Git + run: | + git config --global user.name "github-actions" + git config --global user.email "action@github.com" + + - name: Semantic Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + run: semantic-release publish \ No newline at end of file diff --git a/README.md b/README.md index c0c5c47..fc56d33 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ SLIM CLI is a command-line tool designed to infuse SLIM best practices seamlessl - [Local Development](#local-development) - [Running Tests](#running-tests) - [Publishing a New Version](#publishing-a-new-version) + - [How It Works](#how-it-works) + - [Commit Message Format](#commit-message-format) + - [Examples](#examples-1) - [License](#license) - [Support](#support) @@ -407,30 +410,60 @@ pytest -v -s ### Publishing a New Version -To publish a new version of SLIM CLI to the Python Package Index, follow these steps: +This project uses semantic versioning with automated release management. New versions are automatically published based on conventional commit messages. -1. Create a Git tag for the new version: - ```bash - # Create the tag (use the appropriate version number) - git tag v0.1.0 - - # Push the tag to the repository - git push origin v0.1.0 - ``` +#### How It Works -2. The GitHub Actions workflow will automatically: - - Extract the version from the tag - - Update the version file - - Build the package - - Publish it to PyPI +1. The project uses `python-semantic-release` to analyze commit messages and determine the appropriate version bump +2. When changes are pushed to the `main` branch, a GitHub Actions workflow automatically: + - Determines the next version number based on commit messages + - Updates the version in `src/jpl/slim/VERSION.txt` + - Creates a GitHub release + - Builds and publishes the package to PyPI using trusted publishing -If you need to remove a tag (e.g., if there was an issue): -```bash -# Remove the tag locally -git tag -d v0.1.0 +#### Commit Message Format + +To properly trigger version updates, follow the [Conventional Commits](https://www.conventionalcommits.org/) format: + +``` +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +Where `type` is one of: + +- `feat`: A new feature (triggers a minor version bump) +- `fix`: A bug fix (triggers a patch version bump) +- `docs`: Documentation changes (no version bump) +- `style`: Code style changes (no version bump) +- `refactor`: Code refactoring (no version bump) +- `perf`: Performance improvements (no version bump) +- `test`: Adding or fixing tests (no version bump) +- `build`: Changes to build system (no version bump) +- `ci`: Changes to CI configuration (no version bump) +- `chore`: Other changes (no version bump) + +Include `BREAKING CHANGE:` in the commit footer to trigger a major version bump. + +#### Examples + +Patch release (bumps 1.2.3 to 1.2.4): +``` +fix: resolve issue with command line argument parsing +``` + +Minor release (bumps 1.2.3 to 1.3.0): +``` +feat: add support for custom configuration files +``` + +Major release (bumps 1.2.3 to 2.0.0): +``` +feat: migrate to new API architecture -# Remove the tag from the remote repository -git push --delete origin v0.1.0 ``` ## License diff --git a/pyproject.toml b/pyproject.toml index fc3f992..619a69f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = 'slim-cli' dynamic = ['version'] -requires-python = '>=3.7' +requires-python = '>=3.9' dependencies = [ # Note: these dependencies were taking from original `requirements.txt` # file (now retired in favor of this file, `pyproject.toml`). However, @@ -62,3 +62,12 @@ packages = ['src/jpl'] [build-system] requires = ['hatchling'] build-backend = 'hatchling.build' + + +[tool.semantic_release] +version_source = "commit" +branch = "main" +upload_to_pypi = true +upload_to_release = true +build_command = "python -m build" +version_variable = ["src/jpl/slim/VERSION.txt:"] \ No newline at end of file From ecff5b7a8111793dc07fec1e265bb1184ceb7c88 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Sun, 27 Apr 2025 14:36:53 +0000 Subject: [PATCH 05/18] 0.0.9 Automatically generated by python-semantic-release --- CHANGELOG.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea77a3e..9ed4ad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,12 @@ -# Changelog +# CHANGELOG -All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v0.0.9 (2025-04-27) -## [X.Y.Z] - 2022-MM-DD +### Bug Fixes -### Added +- Semantic release workflow + ([`61a0d28`](https://github.com/yunks128/slim-cli/commit/61a0d28ff648ac73d0c37ce4f59f873d596d6e45)) -- -- -- + +## v0.0.8 (2025-04-15) From bb5e986dfa6da1a12f997fabd0cecb99cf04f5bc Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Sun, 27 Apr 2025 07:42:43 -0700 Subject: [PATCH 06/18] fix: semantic release workflow merged into pypi workflow --- .github/workflows/semantic-release.yml | 35 -------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/semantic-release.yml diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml deleted file mode 100644 index 0d29df4..0000000 --- a/.github/workflows/semantic-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Semantic Release - -on: - push: - branches: - - main - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install python-semantic-release build wheel - - - name: Configure Git - run: | - git config --global user.name "github-actions" - git config --global user.email "action@github.com" - - - name: Semantic Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - run: semantic-release publish \ No newline at end of file From 25dbb5b483387abad87702bb52b0ca87d4099efb Mon Sep 17 00:00:00 2001 From: semantic-release Date: Sun, 27 Apr 2025 14:47:30 +0000 Subject: [PATCH 07/18] 0.0.10 Automatically generated by python-semantic-release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ed4ad1..425fabc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # CHANGELOG +## v0.0.10 (2025-04-27) + + ## v0.0.9 (2025-04-27) ### Bug Fixes @@ -8,5 +11,8 @@ - Semantic release workflow ([`61a0d28`](https://github.com/yunks128/slim-cli/commit/61a0d28ff648ac73d0c37ce4f59f873d596d6e45)) +- Semantic release workflow merged into pypi workflow + ([`bb5e986`](https://github.com/yunks128/slim-cli/commit/bb5e986dfa6da1a12f997fabd0cecb99cf04f5bc)) + ## v0.0.8 (2025-04-15) From d34579e63806aaaef0c2aedde6db51648587bebc Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Sun, 27 Apr 2025 08:34:28 -0700 Subject: [PATCH 08/18] workflow improvement --- .github/workflows/publish-to-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 84d89d7..974da41 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -55,7 +55,7 @@ jobs: - name: Upgrade tooling run: | python -m pip install --upgrade pip - pip install build wheel twine + pip install --upgrade build wheel twine - name: Build package run: python -m build . From a29de4f246a23734f09c892a3d76e46a175393d6 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Mon, 28 Apr 2025 16:36:13 -0700 Subject: [PATCH 09/18] auto publish to pypi with semantic release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 961f899..4827f01 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ SLIM CLI is a command-line tool designed to infuse SLIM best practices seamlessl - [Publishing a New Version](#publishing-a-new-version) - [How It Works](#how-it-works) - [Commit Message Format](#commit-message-format) - - [Examples](#examples-1) + - [Examples](#examples) - [License](#license) - [Support](#support) From b58da21578ba72dcfb0d1f91157f9ada8bf6c585 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 15:27:30 -0700 Subject: [PATCH 10/18] automated pypi testing --- pyproject.toml | 2 +- src/jpl/slim/VERSION.txt | 1 - src/jpl/slim/__init__.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 src/jpl/slim/VERSION.txt diff --git a/pyproject.toml b/pyproject.toml index 619a69f..637269c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ slim = 'jpl.slim.cli:main' [tool.hatch.version] -path = 'src/jpl/slim/VERSION.txt' +path = 'src/jpl/slim/__init__.py' pattern = '(?P.+)' diff --git a/src/jpl/slim/VERSION.txt b/src/jpl/slim/VERSION.txt deleted file mode 100644 index 5a5831a..0000000 --- a/src/jpl/slim/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -0.0.7 diff --git a/src/jpl/slim/__init__.py b/src/jpl/slim/__init__.py index c542ba3..d4c794f 100644 --- a/src/jpl/slim/__init__.py +++ b/src/jpl/slim/__init__.py @@ -6,4 +6,4 @@ PACKAGE_NAME = __name__ -__version__ = VERSION = importlib.resources.files(__name__).joinpath('VERSION.txt').read_text().strip() +__version__ = "0.0.7" From e9c423a9ecaa6432d8e5e0885ad355de4dc8e99b Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 15:29:02 -0700 Subject: [PATCH 11/18] fix: test semantic-release --- src/jpl/slim/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jpl/slim/__init__.py b/src/jpl/slim/__init__.py index d4c794f..d2ce8e2 100644 --- a/src/jpl/slim/__init__.py +++ b/src/jpl/slim/__init__.py @@ -6,4 +6,4 @@ PACKAGE_NAME = __name__ -__version__ = "0.0.7" +__version__ = "0.0.10" From 759c10362e79c8bcf63c7d6e047b01de8c07eeb4 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 15:35:08 -0700 Subject: [PATCH 12/18] pypi semantic release --- src/jpl/slim/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/jpl/slim/__init__.py b/src/jpl/slim/__init__.py index d2ce8e2..b237159 100644 --- a/src/jpl/slim/__init__.py +++ b/src/jpl/slim/__init__.py @@ -1,9 +1,7 @@ -# encoding: utf-8 - '''🛠️ SLIM command-line tools.''' +__version__ = "0.0.11" import importlib.resources PACKAGE_NAME = __name__ -__version__ = "0.0.10" From 9a0e800dcf6771e79ba15a0861a902b6d84c2bf3 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 15:38:51 -0700 Subject: [PATCH 13/18] pypi semantic release --- src/jpl/slim/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/jpl/slim/__init__.py b/src/jpl/slim/__init__.py index b237159..d565153 100644 --- a/src/jpl/slim/__init__.py +++ b/src/jpl/slim/__init__.py @@ -1,4 +1,3 @@ -'''🛠️ SLIM command-line tools.''' __version__ = "0.0.11" import importlib.resources From 36ad5db0490f93e0d533cd06d5813dd324f83dd4 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 21:53:17 -0700 Subject: [PATCH 14/18] Revert "automated pypi testing" This reverts commit b58da21578ba72dcfb0d1f91157f9ada8bf6c585. --- pyproject.toml | 2 +- src/jpl/slim/VERSION.txt | 1 + src/jpl/slim/__init__.py | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/jpl/slim/VERSION.txt diff --git a/pyproject.toml b/pyproject.toml index 637269c..619a69f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ slim = 'jpl.slim.cli:main' [tool.hatch.version] -path = 'src/jpl/slim/__init__.py' +path = 'src/jpl/slim/VERSION.txt' pattern = '(?P.+)' diff --git a/src/jpl/slim/VERSION.txt b/src/jpl/slim/VERSION.txt new file mode 100644 index 0000000..5a5831a --- /dev/null +++ b/src/jpl/slim/VERSION.txt @@ -0,0 +1 @@ +0.0.7 diff --git a/src/jpl/slim/__init__.py b/src/jpl/slim/__init__.py index d565153..c542ba3 100644 --- a/src/jpl/slim/__init__.py +++ b/src/jpl/slim/__init__.py @@ -1,6 +1,9 @@ -__version__ = "0.0.11" +# encoding: utf-8 + +'''🛠️ SLIM command-line tools.''' import importlib.resources PACKAGE_NAME = __name__ +__version__ = VERSION = importlib.resources.files(__name__).joinpath('VERSION.txt').read_text().strip() From bcb88d77361df2f4481f5f67b095531414d0317d Mon Sep 17 00:00:00 2001 From: semantic-release Date: Fri, 2 May 2025 04:53:41 +0000 Subject: [PATCH 15/18] 0.0.11 Automatically generated by python-semantic-release --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 425fabc..9167687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # CHANGELOG +## v0.0.11 (2025-05-02) + +### Bug Fixes + +- Test semantic-release + ([`e9c423a`](https://github.com/yunks128/slim-cli/commit/e9c423a9ecaa6432d8e5e0885ad355de4dc8e99b)) + + ## v0.0.10 (2025-04-27) From fc292d30c67123ca2bdf2640459963c993e21ee0 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 22:06:49 -0700 Subject: [PATCH 16/18] version file manage --- .github/workflows/publish-to-pypi.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 974da41..4e5fd52 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,41 +1,47 @@ name: Semantic Release and PyPI Publish - on: push: branches: - main - jobs: semantic-release: runs-on: ubuntu-latest + outputs: + new_release_published: ${{ steps.semantic_release.outputs.new_release_published }} + new_release_version: ${{ steps.semantic_release.outputs.new_release_version }} steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' - - name: Install dependencies run: | python -m pip install --upgrade pip pip install python-semantic-release build wheel - - name: Configure Git run: | git config --global user.name "github-actions" git config --global user.email "action@github.com" - - name: Semantic Release + id: semantic_release run: | semantic-release version semantic-release publish env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Update VERSION.txt file + if: steps.semantic_release.outputs.new_release_published == 'true' + run: | + echo "${{ steps.semantic_release.outputs.new_release_version }}" > src/jpl/slim/VERSION.txt + git add src/jpl/slim/VERSION.txt + git commit -m "chore: update VERSION.txt to ${{ steps.semantic_release.outputs.new_release_version }}" + git push + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} build: needs: semantic-release if: needs.semantic-release.outputs.new_release_published == 'true' @@ -46,23 +52,18 @@ jobs: with: fetch-depth: 0 ref: main # Ensure we get the latest commit with version update - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' - - name: Upgrade tooling run: | python -m pip install --upgrade pip pip install --upgrade build wheel twine - - name: Build package run: python -m build . - - name: Verify package run: twine check dist/* - - name: Store package uses: actions/upload-artifact@v4 with: @@ -71,7 +72,6 @@ jobs: dist/*.whl dist/*.tar.gz if-no-files-found: error - publish: runs-on: ubuntu-latest needs: build @@ -85,7 +85,6 @@ jobs: with: name: python-package-distribution path: dist/ - - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From aa26e7aadf66e584c3fb4ec0f1fb8012b4988ae7 Mon Sep 17 00:00:00 2001 From: Kyongsik Yun Date: Thu, 1 May 2025 22:09:10 -0700 Subject: [PATCH 17/18] fix: version file manage --- src/jpl/slim/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jpl/slim/VERSION.txt b/src/jpl/slim/VERSION.txt index 5a5831a..2cfabea 100644 --- a/src/jpl/slim/VERSION.txt +++ b/src/jpl/slim/VERSION.txt @@ -1 +1 @@ -0.0.7 +0.0.11 From 3956ce4416d447aee2f52365c6f4b4b753f34921 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Fri, 2 May 2025 05:09:31 +0000 Subject: [PATCH 18/18] 0.0.12 Automatically generated by python-semantic-release --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9167687..bc08d82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # CHANGELOG +## v0.0.12 (2025-05-02) + +### Bug Fixes + +- Version file manage + ([`aa26e7a`](https://github.com/yunks128/slim-cli/commit/aa26e7aadf66e584c3fb4ec0f1fb8012b4988ae7)) + + ## v0.0.11 (2025-05-02) ### Bug Fixes