Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Test different release code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 4, 2023
1 parent 46caed8 commit 6c1e1b6
Showing 1 changed file with 38 additions and 23 deletions.
61 changes: 38 additions & 23 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
name: Publish to PyPI
name: Publish To PyPi

on:
workflow_dispatch:
inputs:
version:
description: 'version'
required: true
push:
tags:
- '*.*.*'

jobs:
pypi:
if: ${{ inputs.pip}}
release:
name: Release
runs-on: ubuntu-latest
name: create pypi
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{inputs.version}}
- name: Set up Python 3.11.4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.11.4'
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Build
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: Push to pypi
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

- name: Check Version
id: check-version
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT
- 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

0 comments on commit 6c1e1b6

Please sign in to comment.