Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Oct 5, 2023
1 parent fe24008 commit eaa6b2b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release to PyPI
on:
release:
types: [published, edited]
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'

- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
- name: install twine
run: |
pip install twine
- name: download release
run: |
tag='${{ github.ref }}'
tag="${tag/refs\/tags\//}"
mkdir dist
cd dist
gh release download "$tag" -p 'extism-*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: upload release
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Extism Python Host SDK

See [https://extism.org/docs/integrate-into-your-codebase/python-host-sdk/](https://extism.org/docs/integrate-into-your-codebase/python-host-sdk/).
See [https://extism.org/docs/integrate-into-your-codebase/python-host-sdk/](https://extism.org/docs/integrate-into-your-codebase/python-host-sdk/).


## Development

### Release workflow

1. Create a semver-formatted git tag (`git tag v1.0.0`).
2. Push that tag to the repository (`git push origin v1.0.0`.)
3. Wait for [the Build workflow to run](https://github.com/extism/python-sdk/actions/workflows/build.yaml).
4. Once the build workflow finishes, go to the [releases](https://github.com/extism/python-sdk/releases) page. You should
see a draft release.
5. Edit the draft release. Publish the release.
6. Wait for [the Release workflow to run](https://github.com/extism/python-sdk/actions/workflows/release.yaml).
7. Once the release workflow completes, you should be able to `pip install extism==${YOUR_TAG}` from PyPI.

0 comments on commit eaa6b2b

Please sign in to comment.