CI / CI (push) Successful in 32m9s
artifact-upload served two purposes: 1. download wheel from Actions UI for debugging 2. (future) hand off to cross-job tests Neither is currently used: distribution already goes through the Gitea release via create-release.sh, and there are no downstream jobs that need the artifact. Removes the actions/upload-artifact@v4 step + the if: success() gate. The build is now: uv build -> release (tag only) -> bark notify. Cleaner, one fewer thing to fail on. Co-Authored-By: Claude <noreply@anthropic.com>
63 lines
2.3 KiB
YAML
63 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
ci:
|
|
name: CI
|
|
# Standard GitHub-hosted ubuntu runner. uv is installed via the
|
|
# astral-sh/setup-uv action (one extra step vs. using a self-hosted
|
|
# runner with uv pre-installed, but matches what GitHub-hosted CI
|
|
# provides out of the box).
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up uv
|
|
uses: https://github.com/astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Build package
|
|
env:
|
|
# Use the Tsinghua PyPI mirror for build-environment resolution;
|
|
# the runner is in China and the default pypi.org is too slow
|
|
# / unreliable for build dependency install.
|
|
UV_DEFAULT_INDEX: "https://pypi.tuna.tsinghua.edu.cn/simple/"
|
|
run: uv build
|
|
|
|
# Only create a release + attach dist/ assets when pushing a v* tag.
|
|
# On branch pushes / pull requests this step is skipped entirely.
|
|
# The release logic is in a separate script to avoid embedding a JSON
|
|
# heredoc inside a YAML block scalar (the previous version of this
|
|
# step was rejected by Gitea's YAML parser at line 51).
|
|
- name: Upload release assets via Gitea API
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG_NAME: ${{ github.ref_name }}
|
|
API_URL: ${{ github.api_url }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
SHA: ${{ github.sha }}
|
|
run: ./.github/scripts/create-release.sh
|
|
|
|
# Always run, regardless of job status. The script is a side-effect;
|
|
# if the notification itself fails we swallow the error so CI does
|
|
# not turn red on a Bark outage.
|
|
- name: Notify Bark
|
|
if: always()
|
|
run: |
|
|
if [ "${{ job.status }}" = "success" ]; then
|
|
TITLE="✅ CI: ${{ github.repository }}@${{ github.ref_name }}"
|
|
BODY="Build OK for ${{ github.sha }} by ${{ github.actor }}"
|
|
else
|
|
TITLE="❌ CI: ${{ github.repository }}@${{ github.ref_name }}"
|
|
BODY="Build FAILED for ${{ github.sha }} by ${{ github.actor }}"
|
|
fi
|
|
./.github/scripts/bark-notify.sh "$TITLE" "$BODY" || echo "Bark notify failed (non-fatal)"
|