Skip to content

Commit

Permalink
👷 Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BalconyJH committed Jan 13, 2025
1 parent a35a0f8 commit 8bb92b9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
53 changes: 45 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,65 @@
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/[email protected]
with:
python-version: 3.9

- name: Get Version
id: version
run: |
INPUT_VERSION="${{ github.event.inputs.version }}"
TAG_VERSION=${{ github.ref_name || '' }}
VERSION=$(pdm show --version)
echo "Debug - Parsed VERSION: $VERSION"
echo "Debug - INPUT_VERSION: $INPUT_VERSION"
echo "Debug - TAG_VERSION: $TAG_VERSION"
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 }}

3 changes: 2 additions & 1 deletion docs/topics/Installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ at this time:

| **Version** | **Build** | **Release Date** | **Status** | **Notes** |
|-------------|--------------|------------------|------------|-----------------------|
| 0.1.2 | PyPI Release | 15/11/2024 | Latest | Initial testing phase |
| 0.2.0 | PyPI Release | 13/1/2025 | Latest | Initial testing phase |
| 0.1.2 | PyPI Release | 15/11/2024 | Old | Initial testing phase |

## System requirements

Expand Down
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aioarxiv"
version = "0.1.2"
version = "0.2.0"
description = "arxiv Parse library"
authors = [
{ name = "BalconyJH", email = "[email protected]" },
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 8bb92b9

Please sign in to comment.