-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,61 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version to release (e.g., v1.0.0)" | ||
required: true | ||
default: "" | ||
|
||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
pypi-publish: | ||
name: upload release to PyPI | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Get Version | ||
id: version | ||
run: | | ||
INPUT_VERSION="${{ github.event.inputs.version }}" | ||
TAG_VERSION=${{ github.ref_name || '' }} | ||
VERSION=$(grep "version = " pyproject.toml | cut -d'"' -f2) | ||
if [ -n "$INPUT_VERSION" ]; then | ||
echo "VERSION=$INPUT_VERSION" >> $GITHUB_OUTPUT | ||
echo "TAG_VERSION=${INPUT_VERSION#v}" >> $GITHUB_OUTPUT | ||
else | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
echo "TAG_VERSION=${TAG_VERSION#v}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Check Version | ||
if: ${{ steps.version.outputs.VERSION != steps.version.outputs.TAG_VERSION }} | ||
run: exit 1 | ||
|
||
- uses: pdm-project/setup-pdm@v3 | ||
- name: Build distribution files | ||
run: pdm build | ||
|
||
- name: Publish package distributions to PyPI | ||
run: pdm publish | ||
|
||
- name: Get Version | ||
id: version | ||
- name: Publish package to GitHub | ||
run: | | ||
echo "VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT | ||
echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "aioarxiv" | ||
version = "0.1.2" | ||
version = "0.2.1" | ||
description = "arxiv Parse library" | ||
authors = [ | ||
{ name = "BalconyJH", email = "[email protected]" }, | ||
|
@@ -30,35 +30,42 @@ line-length = 88 | |
target-version = "py39" | ||
|
||
[tool.ruff.lint] | ||
exclude = ["typings/*/"] | ||
select = [ | ||
"F", # Pyflakes | ||
"W", # pycodestyle warnings | ||
"E", # pycodestyle errors | ||
"I", # isort | ||
"UP", # pyupgrade | ||
"ASYNC", # flake8-async | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"DTZ", # flake8-datetimez | ||
"T10", # flake8-debugger | ||
"T20", # flake8-print | ||
"PYI", # flake8-pyi | ||
"PT", # flake8-pytest-style | ||
"Q", # flake8-quotes | ||
"SIM", # flake8-simplify | ||
"TID", # flake8-tidy-imports | ||
"PLE", # Pylint errors | ||
"NPY", # NumPy-specific rules | ||
"RUF", # Ruff-specific rules | ||
"DTZ", # flake8-datetimez | ||
"SIM", # flake8-simplify | ||
"ISC", # flake8-implicit-str-concat | ||
] | ||
ignore = [ | ||
"E402", # module-import-not-at-top-of-file | ||
"UP037", # quoted-annotation | ||
"B008", # function-call-in-default-argument | ||
"RUF001", # ambiguous-unicode-character-string | ||
"RUF002", # ambiguous-unicode-character-docstring | ||
"RUF003", # ambiguous-unicode-character-comment | ||
"ISC001" # single-line-implicit-string-concatenation | ||
] | ||
|
||
[tool.ruff.format] | ||
line-ending = "lf" | ||
|
||
[tool.ruff.lint.isort] | ||
length-sort = false | ||
force-sort-within-sections = true | ||
known-first-party = ["aioarxiv", "tests/*"] | ||
extra-standard-library = ["typing_extensions"] | ||
|