This repository was archived by the owner on Jan 1, 2026. It is now read-only.
Add products endpoint (#11) #9
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: Build Python Package | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| statuses: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| TRIGGER_BRANCH: main | |
| FILE_FILTER_PATTERN: '^app/version\.py$|^app/routes/v[0-9]+/__init__\.py$' | |
| jobs: | |
| version-bump: | |
| uses: ./.github/workflows/suggest-version-bump.yml | |
| release: | |
| needs: version-bump | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code and fetch tags | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for modified matching files | |
| id: check_changes | |
| run: | | |
| echo "Trigger branch: $TRIGGER_BRANCH" | |
| echo "File filter pattern: $FILE_FILTER_PATTERN" | |
| git fetch origin "$TRIGGER_BRANCH" --depth=2 | |
| MODIFIED=$(git diff --name-only origin/"$TRIGGER_BRANCH"...HEAD) | |
| echo "Modified files:" | |
| echo "$MODIFIED" | |
| MATCHING=$(echo "$MODIFIED" | grep -E "$FILE_FILTER_PATTERN" || true) | |
| echo "Matching files:" | |
| echo "$MATCHING" | |
| if [[ -n "$MATCHING" ]]; then | |
| echo "should_trigger=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "should_trigger=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12.11' | |
| - name: Install build dependencies | |
| run: pip install --user build | |
| - name: Set PYTHONPATH so setuptools can find version.py | |
| run: echo "PYTHONPATH=${{ github.workspace }}/app" >> "$GITHUB_ENV" | |
| - name: Build the binary wheel and source tarball | |
| run: python -m build | |
| working-directory: ${{ github.workspace }} | |
| - name: Create draft release and upload package | |
| if: steps.check_changes.outputs.should_trigger == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.version-bump.outputs.next_version }} | |
| draft: true | |
| generate_release_notes: true | |
| name: Version ${{ needs.version-bump.outputs.next_version }} | |
| files: | | |
| dist/*.tar.gz | |
| dist/*.whl |