Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["main"]
pull_request:
branches: ["**"]
workflow_call: # Allow this workflow to be called by other workflows

permissions:
contents: read
Expand Down Expand Up @@ -76,4 +77,29 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: DrWheelicus/encoderize
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/
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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
secrets: inherit

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, publish-pypi]
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/*
Loading