From dd945324a2ecd14b0cbfe2deba2f242ef3393d77 Mon Sep 17 00:00:00 2001 From: Ulysses Zhan Date: Fri, 27 Dec 2024 21:41:45 -0800 Subject: [PATCH] use gh action for releasing to pypi --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5768dd1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Build + run: | + python3 -m pip install --user build + python3 -m build + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + name: Publish + runs-on: ubuntu-latest + needs: [build] + permissions: + id-token: write + environment: + name: release + url: https://pypi.org/p/yt-dlp-danmaku + steps: + - name: Download + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1