-
Notifications
You must be signed in to change notification settings - Fork 24
Add GitHub Actions Workflow for Building and Uploading Windows Wheel Packages #82
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3db86fe
Add build-windows-wheel.yml
harmonsir ca8d83f
Merge branch 'tursodatabase:main' into main
swoiow f852d99
Update build-windows-wheel.yml
swoiow a5861cb
Update build-windows-wheel.yml
swoiow 268b5a5
Update build-windows-wheel.yml
swoiow 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
93 changes: 93 additions & 0 deletions
.github/workflows/build-windows-wheel.yml
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,93 @@ | ||
name: Build Windows Wheel | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-wheel: | ||
runs-on: windows-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [ "3.13", "3.12" ] | ||
|
||
steps: | ||
- name: Checkout repository code | ||
# zh: 检出仓库代码 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
# zh: 设置 Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Verify Python version | ||
# zh: 验证 Python 版本 | ||
run: python --version | ||
|
||
- name: Set up Rust | ||
# zh: 设置 Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Verify Rust version | ||
# zh: 验证 Rust 版本 | ||
run: rustc --version | ||
|
||
- name: Install dependencies | ||
# zh: 安装依赖 | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel Cython build | ||
# python -m pip install -r requirements.txt # zh: 根据项目实际需求调整 | ||
|
||
- name: Build Wheel | ||
# zh: 构建 Wheel | ||
run: python -m build --wheel | ||
|
||
- name: Find and upload Wheel file | ||
# zh: 查找并上传 Wheel 文件 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: built-wheel-${{ matrix.python-version }} | ||
path: | | ||
dist/*.whl | ||
|
||
# - name: Publish to PyPI | ||
# # zh: 发布到 PyPI | ||
# uses: PyO3/maturin-action@v1 | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
# with: | ||
# command: upload | ||
# args: --skip-existing * | ||
# env: | ||
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Upload Wheel to GitHub Releases | ||
# zh: 上传 Wheel 到 GitHub Releases | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
overwrite: true | ||
tag_name: released | ||
name: latest-whl | ||
draft: false | ||
prerelease: true | ||
make_latest: true | ||
generate_release_notes: true | ||
# upload_url: ${{ github.event.release.upload_url }} | ||
files: ${{ github.workspace }}/dist/*.whl | ||
# asset_name: your_package_name-${{ matrix.python-version }}.whl # zh: 请替换为实际的 wheel 文件名 | ||
# asset_content_type: application/octet-stream |
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.