Release #2
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: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for release notes | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| cache-dependency-path: smoosense-gui/pnpm-lock.yaml | |
| - name: Wait for CI to pass | |
| uses: lewagon/wait-on-check-action@v1.3.4 | |
| with: | |
| ref: ${{ github.ref }} | |
| check-name: 'GUI Tests' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| wait-interval: 10 | |
| - name: Wait for Python tests to pass | |
| uses: lewagon/wait-on-check-action@v1.3.4 | |
| with: | |
| ref: ${{ github.ref }} | |
| check-name: 'Python Tests' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| wait-interval: 10 | |
| - name: Wait for integration tests to pass | |
| uses: lewagon/wait-on-check-action@v1.3.4 | |
| with: | |
| ref: ${{ github.ref }} | |
| check-name: 'Python Integration Tests' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| wait-interval: 10 | |
| - name: Get previous version | |
| id: prev_version | |
| run: | | |
| cd smoosense-py | |
| PREV_VERSION=$(uv version --short) | |
| echo "version=$PREV_VERSION" >> $GITHUB_OUTPUT | |
| echo "Previous version: $PREV_VERSION" | |
| - name: Bump version | |
| run: | | |
| cd smoosense-py | |
| uv version --bump patch | |
| - name: Get new version | |
| id: new_version | |
| run: | | |
| cd smoosense-py | |
| NEW_VERSION=$(uv version --short) | |
| echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| echo "New version: $NEW_VERSION" | |
| - name: Install dependencies | |
| run: | | |
| make -C smoosense-gui env | |
| make -C smoosense-py env | |
| - name: Build local | |
| run: make build-local | |
| - name: Commit and push version bump | |
| run: | | |
| git add -A | |
| git commit -m "Release v${{ steps.new_version.outputs.version }}" | |
| git push origin main | |
| - name: Create and push tag | |
| run: | | |
| git tag -a "v${{ steps.new_version.outputs.version }}" -m "Release v${{ steps.new_version.outputs.version }}" | |
| git push origin "v${{ steps.new_version.outputs.version }}" | |
| - name: Publish to PyPI | |
| run: make -C smoosense-py publish | |
| env: | |
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| PREV_TAG="v${{ steps.prev_version.outputs.version }}" | |
| NEW_TAG="v${{ steps.new_version.outputs.version }}" | |
| echo "Generating release notes from $PREV_TAG to $NEW_TAG" | |
| # Get commit messages | |
| COMMITS=$(git log $PREV_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges) | |
| # Create release notes | |
| cat > release_notes.md <<EOF | |
| ## What's Changed | |
| $COMMITS | |
| **Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREV_TAG...$NEW_TAG | |
| EOF | |
| cat release_notes.md | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.new_version.outputs.version }} | |
| release_name: v${{ steps.new_version.outputs.version }} | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false |