Files
pyflowx/.github/workflows/release.yml
T
zhou 77918a5568
CI / Lint, Typecheck & Test (push) Failing after 1s
ci: 替换github actions为国内gitcode镜像源
2026-07-02 20:48:48 +08:00

48 lines
1.5 KiB
YAML

name: Release
on:
push:
tags: ['v*.*.*']
permissions:
contents: write
jobs:
release:
name: Build, Publish & Release
runs-on: ubuntu-latest
steps:
- uses: https://gitcode.com/GitHub_Trending/ch/checkout.git@v4
- uses: https://gitcode.com/gh_mirrors/se/setup-uv.git@v8.1.0
with:
enable-cache: true
- uses: https://gitcode.com/gh_mirrors/se/setup-python.git@v6
with:
python-version: '3.13'
- run: uv build
- uses: https://gitcode.com/gh_mirrors/gh/gh-action-pypi-publish.git@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Gitea Release
run: |
VERSION=${GITHUB_REF#refs/tags/v}
REPO=${GITHUB_REPOSITORY}
UPLOAD_URL=$(curl -s -X POST "https://git.gookeryoung.cn/api/v1/repos/${REPO}/releases" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"v${VERSION}\", \"name\": \"v${VERSION}\", \"draft\": false, \"prerelease\": false}" \
| jq -r '.upload_url')
for file in dist/*; do
curl -s -X POST "${UPLOAD_URL}?name=$(basename $file)" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$file"
done
env:
GITEA_URL: ${{ secrets.GITEA_URL || 'https://git.gookeryoung.cn' }}