From 9d93174fa5094a19b34c6bb594f157698ad1d328 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sun, 15 Feb 2026 16:38:20 -0500 Subject: [PATCH 1/3] feat: enhance CI/CD workflows for package building and release - Added a new job to the Python CI workflow for building the package and uploading artifacts. - Introduced a new release workflow for publishing to PyPI and creating GitHub releases upon version tag pushes. - Updated Python version to 3.13 in the CI workflow for compatibility with the latest features. --- .github/workflows/python-app.yml | 28 +++++++++++++++++- .github/workflows/release.yml | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 948e93d..636eccd 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,6 +5,7 @@ on: branches: ["main"] pull_request: branches: ["**"] + workflow_call: # Allow this workflow to be called by other workflows permissions: contents: read @@ -76,4 +77,29 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: DrWheelicus/encoderize \ No newline at end of file + slug: DrWheelicus/encoderize + + build_package: + runs-on: ubuntu-latest + needs: lint_and_test + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: python -m build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8e051d1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release to PyPI + +on: + push: + tags: + - "v*" + +permissions: + contents: write + id-token: write + +jobs: + # Reuse the existing CI workflow for testing and building + ci: + uses: ./.github/workflows/python-app.yml + + publish-pypi: + needs: ci + runs-on: ubuntu-latest + environment: + name: Main Deployment + url: https://pypi.org/project/encoderize/ + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + needs: ci + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: dist/* From ab3fdd960bec4a4e287b3f15c8d14e9d87c1d963 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Feb 2026 21:49:09 +0000 Subject: [PATCH 2/3] fix(release): inherit secrets when calling CI workflow Co-authored-by: Hayden MacIntyre --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e051d1..458a7b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ jobs: # Reuse the existing CI workflow for testing and building ci: uses: ./.github/workflows/python-app.yml + secrets: inherit publish-pypi: needs: ci From 02f6aab236ca3d19848de1df72d28205db30ed4c Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sun, 15 Feb 2026 16:56:11 -0500 Subject: [PATCH 3/3] chore(release): update job dependencies in release workflow Modified the 'github-release' job to depend on both 'ci' and 'publish-pypi' jobs, ensuring that the release process waits for successful completion of both prior jobs before proceeding. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 458a7b8..6fb4b35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 github-release: - needs: ci + needs: [ci, publish-pypi] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4