-
Notifications
You must be signed in to change notification settings - Fork 1
feat: tag-triggered release workflow for wheel, sdist and Windows bundle #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
94aa46b
feat: add tag-triggered release workflow for wheel, sdist and Windows…
clean6378-max-it 0571377
ci: limit release contents write to publish job and fix tag docs
clean6378-max-it 8b8eca2
Address brad's feedback
clean6378-max-it 319d6da
add whl, tar.gz test more
clean6378-max-it ae0c38b
clean up content
clean6378-max-it aa85b93
ci: enforce tag version match and pywebview bundle checks
clean6378-max-it 4b20d95
moving guard from inline in tests.yml
clean6378-max-it File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| name: Release | ||
|
|
||
| # v* tag push: build wheel, sdist, and Windows zip; publish attaches all three to the Release. | ||
| # workflow_dispatch runs the build jobs only (no publish). | ||
| # | ||
| # Asset names (version from pyproject.toml at the tagged commit): | ||
| # cppa_cursor_browser-<version>-py3-none-any.whl (~154 KiB at 0.2.0) | ||
| # cppa_cursor_browser-<version>.tar.gz (~225 KiB at 0.2.0) | ||
| # CursorChatBrowser-windows.zip | ||
| # | ||
| # Fork check: push v0.0.0-test and confirm all three files on the Release. | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build-python: | ||
| name: Build wheel and sdist | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Build hatchling distributables | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install 'build>=1,<2' | ||
| python -m build | ||
|
|
||
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: python-distributables | ||
| path: | | ||
| dist/*.whl | ||
| dist/*.tar.gz | ||
| if-no-files-found: error | ||
|
|
||
| build-windows: | ||
| name: Build Windows PyInstaller bundle | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install runtime dependencies | ||
| # requirements-lock.txt for runtime; pywebview for the desktop window. | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements-lock.txt | ||
| python -m pip install 'pywebview>=5.0,<7' | ||
|
|
||
| - name: Install PyInstaller | ||
| run: python -m pip install 'pyinstaller>=6,<7' | ||
|
|
||
| - name: Build PyInstaller bundle | ||
| run: pyinstaller cursor-browser.spec --noconfirm | ||
|
|
||
| - name: Smoke-test PyInstaller exe (--help) | ||
| run: dist\CursorChatBrowser\CursorChatBrowser.exe --help | ||
|
|
||
| - name: Zip onedir bundle | ||
| shell: pwsh | ||
| run: | | ||
| if (-not (Test-Path dist\CursorChatBrowser\CursorChatBrowser.exe)) { | ||
| Write-Error "dist\CursorChatBrowser\CursorChatBrowser.exe not found" | ||
| exit 1 | ||
| } | ||
| Compress-Archive -Path dist\CursorChatBrowser -DestinationPath CursorChatBrowser-windows.zip | ||
|
|
||
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: windows-bundle | ||
| path: CursorChatBrowser-windows.zip | ||
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| name: Publish GitHub Release assets | ||
| needs: [build-python, build-windows] | ||
| if: github.event_name == 'push' && github.ref_type == 'tag' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download Python distributables | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| with: | ||
| name: python-distributables | ||
| path: release-assets | ||
|
|
||
| - name: Download Windows bundle | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| with: | ||
| name: windows-bundle | ||
| path: release-assets | ||
|
|
||
| - name: Verify release asset set | ||
| env: | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| run: | | ||
| set -euo pipefail | ||
| version="${RELEASE_TAG#v}" | ||
| ls -la release-assets/ | ||
| count=$(find release-assets -maxdepth 1 -type f | wc -l) | ||
| test "$count" -eq 3 | ||
| test -f "release-assets/cppa_cursor_browser-${version}-py3-none-any.whl" | ||
| test -f "release-assets/cppa_cursor_browser-${version}.tar.gz" | ||
| test -f release-assets/CursorChatBrowser-windows.zip | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Attach artifacts to Release | ||
|
clean6378-max-it marked this conversation as resolved.
|
||
| uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2 | ||
| with: | ||
| files: release-assets/* | ||
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.