The Release workflow was failing with ModuleNotFoundError because it wasn't installing the package before running tests. Added 'pip install -e .' step to install the skill_seekers package in editable mode, which is required for the src/ layout structure introduced in v2.0.0. This is the same fix applied to the Tests workflow earlier. Fixes the failing Release check for v2.1.0 tag.
75 lines
2.1 KiB
YAML
75 lines
2.1 KiB
YAML
name: Release
|
||
|
||
on:
|
||
push:
|
||
tags:
|
||
- 'v*'
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v3
|
||
|
||
- name: Set up Python
|
||
uses: actions/setup-python@v4
|
||
with:
|
||
python-version: '3.10'
|
||
|
||
- name: Install dependencies
|
||
run: |
|
||
python -m pip install --upgrade pip
|
||
pip install -r requirements.txt
|
||
if [ -f skill_seeker_mcp/requirements.txt ]; then pip install -r skill_seeker_mcp/requirements.txt; fi
|
||
# Install package in editable mode for tests (required for src/ layout)
|
||
pip install -e .
|
||
|
||
- name: Run tests
|
||
run: |
|
||
python -m pytest tests/ -v
|
||
|
||
- name: Extract version from tag
|
||
id: get_version
|
||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||
|
||
- name: Create Release Notes
|
||
id: release_notes
|
||
run: |
|
||
if [ -f CHANGELOG.md ]; then
|
||
# Extract changelog for this version
|
||
sed -n "/## \[${{ steps.get_version.outputs.VERSION }}\]/,/## \[/p" CHANGELOG.md | sed '$d' > release_notes.md
|
||
else
|
||
echo "Release ${{ steps.get_version.outputs.VERSION }}" > release_notes.md
|
||
fi
|
||
|
||
- name: Check if release exists
|
||
id: check_release
|
||
run: |
|
||
if gh release view ${{ github.ref_name }} > /dev/null 2>&1; then
|
||
echo "exists=true" >> $GITHUB_OUTPUT
|
||
else
|
||
echo "exists=false" >> $GITHUB_OUTPUT
|
||
fi
|
||
env:
|
||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
- name: Create GitHub Release
|
||
if: steps.check_release.outputs.exists == 'false'
|
||
uses: softprops/action-gh-release@v1
|
||
with:
|
||
body_path: release_notes.md
|
||
draft: false
|
||
prerelease: false
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
- name: Skip Release Creation
|
||
if: steps.check_release.outputs.exists == 'true'
|
||
run: |
|
||
echo "ℹ️ Release ${{ github.ref_name }} already exists, skipping creation"
|
||
echo "View at: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
|