From a80db64ced9cdd117dc48ece1f4e7b5f5f696d6b Mon Sep 17 00:00:00 2001 From: Akirami <66513481+A-kirami@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8F=91=E5=B8=83=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release-drafter.yml | 18 +++++++++++++++++ .github/release.yml | 17 ---------------- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 .github/release-drafter.yml delete mode 100644 .github/release.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..30e4a49 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,18 @@ +template: $CHANGES +category-template: "### $TITLE" +change-template: "- $TITLE ([#$NUMBER]($URL)) @$AUTHOR" +change-title-escapes: '\<&' +exclude-labels: + - "dependencies" + - "skip-changelog" +categories: + - title: "💥 破坏性变更" + labels: + - "breaking" + - title: "✨ 新功能" + labels: + - "enhancement" + - title: "🐛 错误修复" + labels: + - "bug" + - title: "💫 杂项" diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index f4f2ef2..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -changelog: - categories: - - title: 💥 破坏性 - labels: - - breaking - - title: ✨ 新特性 - labels: - - enhancement - - title: 🐛 错误修复 - labels: - - bug - - title: 💫 杂项 - labels: - - "*" - exclude: - labels: - - dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1f88101 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + steps: + - uses: actions/checkout@v3 + + - uses: pdm-project/setup-pdm@v3 + + - name: Build distributions + run: pdm build + + - run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - uses: release-drafter/release-drafter@v5 + with: + name: 🌟 ${{ env.TAG_NAME }} + tag: ${{ env.TAG_NAME }} + publish: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload assets + run: gh release upload --clobber ${{ env.TAG_NAME }} dist/*.tar.gz dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to PyPI + run: pdm publish --no-build