From 4299a2b3401ba3a20a6e3b83c91f6be77cb530ed Mon Sep 17 00:00:00 2001 From: HugoMVale <57530119+HugoMVale@users.noreply.github.com> Date: Sat, 4 Nov 2023 18:43:49 +0100 Subject: [PATCH] update publish actions --- .github/workflows/publish.yml | 16 ------------- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 92704c7..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Publish Python package -on: - push: - tags: - - "v*.*.*" -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build and publish to pypi - uses: JRubics/poetry-publish@v1.17 - with: - python_version: "3.10" - ignore_dev_requirements: "yes" - pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d8b7da7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release and publish package + +on: + push: + tags: + - "*.*.*" + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y + + - name: Update PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Build project for distribution + run: poetry build + + # - name: Create Release + # uses: ncipollo/release-action@v1 + # with: + # artifacts: "dist/*" + # token: ${{ secrets.GITHUB_TOKEN }} + # draft: false + # prerelease: steps.check-version.outputs.prerelease == 'true' + + - name: Publish to PyPI + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: poetry publish