Add requests to dependencies #15
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build-and-publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Hatch | |
run: pip install hatch | |
- name: Build project | |
run: hatch build | |
- name: Publish to PyPI | |
env: | |
HATCH_INDEX_USER: __token__ | |
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} | |
run: hatch publish | |
- name: Get version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
github-release: | |
name: Create GitHub Release | |
needs: build-and-publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "${GITHUB_REF#refs/tags/}" \ | |
--repo '${{ github.repository }}' \ | |
--title "${GITHUB_REF#refs/tags/}" \ | |
--generate-notes | |
verify-installation: | |
name: Verify Package Installation | |
needs: build-and-publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Wait and verify package installation | |
run: | | |
echo "Waiting for PyPI to process the upload..." | |
for i in {1..10}; do | |
if pip install gitmuse==${GITHUB_REF#refs/tags/v} --no-cache-dir; then | |
echo "Package installed successfully" | |
gitmuse version | |
exit 0 | |
fi | |
echo "Attempt $i failed, waiting 30 seconds..." | |
sleep 30 | |
done | |
echo "Error: Could not install package after 10 attempts" | |
exit 1 | |
- name: Debug package info | |
if: failure() | |
run: | | |
pip show gitmuse | |
pip install gitmuse==${GITHUB_REF#refs/tags/v} --no-cache-dir --verbose |