diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5b8ae49..1c7ee7c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,13 +2,32 @@ name: Publish to PyPI on: push: tags: - - "v*.*.*" + - '*' jobs: build: runs-on: ubuntu-latest + permissions: + contents: write steps: - - uses: actions/checkout@v4 - - name: Build and publish to pypi + - name: Checkout Code Repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Build and Publish to PyPI uses: JRubics/poetry-publish@v2.0 with: - pypi_token: ${{ secrets.PIPY_API_TOKEN }} \ No newline at end of file + pypi_token: ${{ secrets.PIPY_API_TOKEN }} + poetry_publish_options: "--skip-existing" + + - name: Create Release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + This is a release for the version ${{ github.ref }}. + PyPI package: https://pypi.org/project/${{ github.repository }}/${{ github.ref }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c0217eb..28ffba4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ cp-hw/ .venv/ poetry.lock +# build files +dist/ + # log files *.log diff --git a/README.md b/README.md index 8e381da..f5de0d5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@
[![Test](https://github.com/ryanlinjui/cpGrader/actions/workflows/tests.yml/badge.svg?branch=main&event=push)](https://github.com/ryanlinjui/cpGrader/actions?query=event%3Apush+branch%3Amain) +[![PyPI](https://img.shields.io/pypi/v/cpGrader.svg)](https://pypi.org/project/cpGrader) +[![python-version](https://img.shields.io/pypi/pyversions/cpGrader.svg)](https://pypi.org/project/cpGrader)
diff --git a/pyproject.toml b/pyproject.toml index 63a593e..79fb963 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cpGrader" -version = "0.1.0" +version = "0.1.2" description = "A Python Package to Grade Programming Assignments Automatically." authors = ["ryanlinjui "] readme = "README.md"