Upload Python Package #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Python Package | |
on: | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
inputs: | |
dothttpversion: | |
description: "version of dothttp-wasm to release (don't prefix `v`)" | |
required: true | |
# default: '0.0.42a12' | |
env: | |
dothttpversion: ${{ github.event.inputs.dothttpversion }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/dothttp-req-wasm | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
git clone https://github.com/cedric05/dothttp.git dothttp | |
cd dothttp | |
git fetch --all | |
git checkout v${{ env.dothttpversion }} | |
python -m pip install -r all_requirements.txt | |
python -m pip install python-magic | |
docker run -d -p 8000:80 kennethreitz/httpbin | |
python -m unittest | |
git apply ../*.patch | |
rm poetry.lock | |
- name: Install dependencies | |
run: | | |
python -m pip install poetry | |
- name: Build | |
run: | | |
cd dothttp | |
poetry build | |
ls -alh dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: dothttp/dist | |