Skip to content

Commit

Permalink
Publish release
Browse files Browse the repository at this point in the history
  • Loading branch information
XFY9326 committed Feb 23, 2024
1 parent 847c611 commit 8519391
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install pytest hatch versioningit
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build dist
run: |
hatch build
- name: Test with pytest
run: |
pytest ./tests/
- name: Upload release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: XFY9326/PyNdef
slug: XFY9326/PyNdef
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# PyNdef

![!python-versions](https://img.shields.io/badge/Python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)
![Pypi](https://img.shields.io/pypi/v/pyndef?color=orange)

[![codecov](https://codecov.io/gh/XFY9326/PyNdef/graph/badge.svg?token=QVJNICD0GA)](https://codecov.io/gh/XFY9326/PyNdef)
[![Test](https://github.com/XFY9326/PyNdef/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/XFY9326/PyNdef/actions/workflows/test.yml)
[![Release](https://github.com/XFY9326/PyNdef/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/XFY9326/PyNdef/actions/workflows/release.yml)

Pure Python library for creating and parsing NDEF messages.
All codes in this repository are referred to AOSP NDEF implementation.
Expand Down
15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"

[project]
dynamic = ["version"]
name = "pyndef"
version = "1.0.0"
requires-python = ">=3.6"
authors = [
{ name = "XFY9326" }
Expand All @@ -14,14 +14,19 @@ maintainers = [
]
description = "Pure Python library for creating and parsing NDEF messages."
readme = "README.md"
license = { file = "LICENSE" }
license = "Apache-2.0"
keywords = ["nfc", "ndef", "ndef-library"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Typing :: Typed"
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
]

[project.urls]
Expand All @@ -36,4 +41,4 @@ pythonpath = "src"
exclude = [".github/"]

[tool.hatch.version]
path = "src/pyndef/__about__.py"
source = "versioningit"

0 comments on commit 8519391

Please sign in to comment.