Skip to content

Commit

Permalink
publish to crates and pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
carderne committed Jul 10, 2024
1 parent 02a6835 commit 0ed212e
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ jobs:
run: rye run check
- name: Test
run: rye run test

publish:
needs: test
environment: release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build
run: |
pip install build
python -m build
- name: Publish
# mimics: twine upload dist/* --skip-existing
uses: pypa/gh-action-pypi-publish@release/v1
21 changes: 21 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@ jobs:
run: cargo clippy
- name: Test
run: cargo test --all-features

publish:
needs: test
environment: release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: set version
env:
RELEASE_TAG: ${{ github.ref }}
run: |
sed -i "s/0\\.0\\.999/${RELEASE_TAG##*\/v}/" upid_rs/Cargo.toml
sed -i "s/0\\.0\\.999/${RELEASE_TAG##*\/v}/" Cargo.lock
- uses: dtolnay/rust-toolchain@stable
- name: publish
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
run: |
cargo publish --package upid --token $CRATES_TOKEN --allow-dirty
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 22 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,31 @@ all = { chain = ["fmt", "lint", "check", "test"] }

[project]
name = "upid"
version = "0.1.0"
description = "Universally Unique Prefixed Lexicographically Sortable Identifier"
authors = [
{ name = "Chris Arderne", email = "[email protected]" }
]
dependencies = []
readme = "README.md"
license = {text = "MIT License"}
requires-python = ">= 3.9"
keywords = ["UUID", "id", "database"]

dynamic = ["version"]

classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
]

dependencies = []

[build-system]
requires = ["pdm-backend"]
Expand All @@ -23,6 +40,9 @@ build-backend = "pdm.backend"
[tool.pdm.build]
package-dir = "py"

[tool.pdm.version]
source = "scm"

[tool.rye]
managed = true
dev-dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion upid_rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Universally Unique Prefixed Lexicographically Sortable Identifier
readme = "../README.md"
repository = "https://github.com/carderne/upid"

version = "0.1.0"
version = "0.0.999" # set by Github Actions CI

edition = "2021"

Expand Down

0 comments on commit 0ed212e

Please sign in to comment.