diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..3e692a7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,26 @@ +name: release + +on: push + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..fec101f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,75 @@ +name: release + +#on: push + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish python distribution to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/cemc-plots-kit + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + publish-to-testpypi: + name: Publish Python distribution to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/cemc-plots-kit + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/README.md b/README.md index 577b336..13451e5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # cemc-plots-kit -CEMC 业务绘图工具。 +适用于 CEMC 数值天气预报模式数据的绘图工具。 ## LICENSE diff --git a/pyproject.toml b/pyproject.toml index ca12b3e..385cd7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "cemc-plots-kit" authors = [ {name="Wang Dapeng", email="perillaroc@gmail.com"} ] -description = "Plots tool in CEMC." +description = "Plots tool for CEMC's NWP Opearting systems." readme = "README.md" keywords = ["graphic", "cemc", "cedarkit"] license = { text = "Apache-2.0" } @@ -33,12 +33,12 @@ dependencies = [ "reki>=2024.4.0", "cedarkit-comp>=2024.4.0", "cedarkit-maps>=2024.4.0", - "cedar-graph", + "cedar-graph>=2024.10.0", ] [project.urls] -Homepage = "http://codingcorp.mc.met.cma/public/cedarkit/cemc-plots-kit/git/files/" -Repository = "http://e.mc.met.cma/codingcorp/cedarkit/cemc-plots-kit.git" +Homepage = "https://github.com/cemc-oper/cemc-plots-kit" +Repository = "https://github.com/cemc-oper/cemc-plots-kit.git" [project.optional-dependencies] test = ["pytest"]