Skip to content

Commit

Permalink
👷 添加自动发布工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Sep 5, 2023
1 parent ddebfe6 commit a80db64
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
18 changes: 18 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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: "💫 杂项"
17 changes: 0 additions & 17 deletions .github/release.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a80db64

Please sign in to comment.