Skip to content

Commit

Permalink
Release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jayqi committed Mar 20, 2024
1 parent 50b55d5 commit 752d9b0
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 7 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
release:
types:
- published

jobs:
build:
name: Publish release
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4

- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: "3.11"

- name: Install requirements
run: |
uv pip install -r dev-requirements.txt
- name: Check that versions match
id: version
run: |
echo "Release tag: [${{ github.ref_name }}]"
PACKAGE_VERSION=$(python -c "import sortedcontainers_pydantic; print(sortedcontainers_pydantic.__version__)")
echo "Package version: [$PACKAGE_VERSION]"
[ "${{ github.ref_name }}" == "v$PACKAGE_VERSION" ] || { exit 1; }
echo "major_minor_version=v${PACKAGE_VERSION%.*}" >> $GITHUB_OUTPUT
- name: Build package
run: |
python -m build
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: ${{ secrets.PYPI_TEST_USERNAME }}
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

- name: Publish to Production PyPI
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: ${{ secrets.PYPI_PROD_USERNAME }}
password: ${{ secrets.PYPI_PROD_PASSWORD }}
skip-existing: false
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v1.0.0 (2024-03-20)

Initial release! 🎉
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Jay Qi
Copyright (c) 2024 DrivenData

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![PyPI](https://img.shields.io/pypi/v/sortedcontainers-pydantic.svg)](https://pypi.org/project/sortedcontainers-pydantic/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/sortedcontainers-pydantic)](https://pypi.org/project/sortedcontainers-pydantic/)
[![tests](https://github.com/jayqi/sortedcontainers-pydantic/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jayqi/sortedcontainers-pydantic/actions/workflows/tests.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/jayqi/sortedcontainers-pydantic/branch/main/graph/badge.svg)](https://codecov.io/gh/jayqi/sortedcontainers-pydantic)
[![tests](https://github.com/drivendataorg/sortedcontainers-pydantic/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/drivendataorg/sortedcontainers-pydantic/actions/workflows/tests.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/drivendataorg/sortedcontainers-pydantic/branch/main/graph/badge.svg)](https://codecov.io/gh/drivendataorg/sortedcontainers-pydantic)

This package adds [Pydantic](https://docs.pydantic.dev/latest/) support to [sortedcontainers](https://github.com/grantjenks/python-sortedcontainers/), a fast pure-Python library for sorted mutable collections.

Expand Down Expand Up @@ -36,8 +36,8 @@ TypeAdapter(SortedList).validate_json("[3, 1, 2]")

## Installation

sortedcontainers-pydantic is not yet available on PyPI. For now, install from GitHub:
sortedcontainers-pydantic is available on [PyPI](https://pypi.org/project/sortedcontainers-pydantic/). You can install it with

```bash
pip install sortedcontainers-pydantic@git+https://github.com/jayqi/sortedcontainers-pydantic.git
pip install sortedcontainers-pydantic
```
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ name = "sortedcontainers-pydantic"
dynamic = ["version"]
description = "Pydantic support for the sortedcontainers package."
readme = "README.md"
authors = [{ name = "Jay Qi", email = "jayqi.opensource@gmail.com" }]
license = { file = "LICENSE" }
authors = [
{ name = "DrivenData", email = "info@drivendata.org" },
{ name = "Jay Qi", email = "jayqi.opensource@gmail.com" },
]
license = { text = "MIT License" }
keywords = ["sorted", "sorteddict", "sortedlist", "sortedset", "pydantic"]
classifiers = [
"Intended Audience :: Developers",
Expand All @@ -20,6 +23,8 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Pydantic",
"Framework :: Pydantic :: 2",
]
requires-python = '>=3.8'
dependencies = ["pydantic>=2", "pydantic-core", "sortedcontainers"]
Expand Down

0 comments on commit 752d9b0

Please sign in to comment.