From aaf9ac5010af8a62a2ef8c55ba0bb2a91d343969 Mon Sep 17 00:00:00 2001 From: prakaa Date: Tue, 20 Aug 2024 17:55:22 +1000 Subject: [PATCH] add steps to publish in github workflow --- .github/workflows/cicd.yml | 50 +++++++++++++++++++++----------------- pyproject.toml | 8 +++--- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index bd1ec06..76eefee 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -46,25 +46,31 @@ jobs: # verbose: true # Publishes to PyPi if tests are passed and release is created -# publish: -# if: github.event_name == 'release' && github.event.action == 'created' -# needs: test -# runs-on: ubuntu-latest -# steps: -# # Checkout repo -# - name: Checkout -# uses: actions/checkout@v3 -# # Install rye with cache -# - name: Install the latest version of rye -# uses: eifinger/setup-rye@v4 -# with: -# enable-cache: true -# # Sync dependencies -# - name: Sync dependencies -# run: rye sync -# # Build and publish to PyPI -# - name: Build and publish to pypi -# uses: JRubics/poetry-publish@v1.17 -# with: -# pypi_token: ${{ secrets.PYPI_TOKEN }} -# \ No newline at end of file + publish: + if: github.event_name == 'release' && github.event.action == 'created' + needs: test + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/isp-workbook-parser/ + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + # Checkout repo + - name: Checkout + uses: actions/checkout@v3 + # Install rye with cache + - name: Install the latest version of rye + uses: eifinger/setup-rye@v4 + with: + enable-cache: true + # Sync dependencies + - name: Sync dependencies + run: rye sync + # Build + - name: Build + run: rye build + # Publish to PyPI + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1token "$PYPI_TOKEN" diff --git a/pyproject.toml b/pyproject.toml index c48a807..bb99dfc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,11 @@ [project] name = "isp-workbook-parser" version = "0.1.0" -description = "Add your description here" +description = "A Python package for reading data from the Inputs, Assumptions and Scenarios Report (IASR) Microsoft Excel workbook published by the Australian Energy Market Operator for use in their Integrated System Plan modelling." authors = [ - { name = "nick-gorman", email = "n.gorman305@gmail.com" } + { name = "nick-gorman", email = "n.gorman305@gmail.com" }, + { name = "prakaa", email = "abiprakash007@gmail.com" }, + { name = "dylanjmcconnell", email = "dylan.mcconnell@unsw.edu.au" } ] dependencies = [ "pandas>=2.2.2", @@ -12,7 +14,7 @@ dependencies = [ "pyyaml>=6.0.1", ] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">= 3.9" [build-system] requires = ["setuptools>=61.0", "wheel"]