release: v0.3.14 (#175) #10
Workflow file for this run
This file contains hidden or 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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| github-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Extract changelog section | |
| id: changelog | |
| run: | | |
| # Extract the section for this version from the changelog | |
| NOTES=$(awk -v ver="${{ steps.version.outputs.version }}" ' | |
| /^## \[/ { | |
| if (found) exit | |
| if (index($0, "[" ver "]")) found=1 | |
| next | |
| } | |
| found && /^---/ { exit } | |
| found { print } | |
| ' docs-site/docs/changelog.md) | |
| # Write to file for gh release | |
| echo "$NOTES" > release_notes.md | |
| # Fail if no changelog entry was found for this version | |
| if [ -z "$(cat release_notes.md | tr -d '[:space:]')" ]; then | |
| echo "::error::No changelog entry found for version ${{ steps.version.outputs.version }}" | |
| exit 1 | |
| fi | |
| - name: Generate OpenAPI spec | |
| run: | | |
| cp VERSION openapi-version.txt | |
| # Generate spec by importing the FastAPI app | |
| pip install -q -r platform/requirements.txt 2>/dev/null || true | |
| python -c " | |
| import json, sys | |
| sys.path.insert(0, 'platform') | |
| from main import app | |
| spec = app.openapi() | |
| with open('openapi.json', 'w') as f: | |
| json.dump(spec, f, indent=2) | |
| print(f'Generated OpenAPI spec v{spec[\"info\"][\"version\"]}') | |
| " || echo "::warning::Could not generate OpenAPI spec — will skip artifact" | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ASSETS="" | |
| [ -f openapi.json ] && ASSETS="openapi.json" | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --title "Pipelit $GITHUB_REF_NAME" \ | |
| --notes-file release_notes.md \ | |
| $ASSETS |