diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ace518..586558c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,12 @@ on: branches: - "main" +permissions: + contents: write + packages: write + jobs: generate-release-body: - if: contains(github.event.head_commit.message, 'chore(release)') runs-on: ubuntu-latest outputs: release_body: ${{ steps.git-cliff.outputs.content }} @@ -23,6 +26,7 @@ jobs: publish: runs-on: ubuntu-latest + if: contains(github.event.head_commit.message, 'chore(release)') needs: [generate-release-body] environment: release permissions: @@ -59,7 +63,30 @@ jobs: release: runs-on: ubuntu-latest - needs: [generate-release-body,publish] + needs: [generate-release-body, publish] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: 3.12 + - name: Get version + run: | + echo PACKAGE_VERSION=`pdm show --version` >> $GITHUB_ENV + - name: Release + uses: ncipollo/release-action@v1 + with: + body: ${{ needs.generate-release-body.outputs.release_body }} + draft: false + updateOnlyUnreleased: true + tag: v${{ env.PACKAGE_VERSION }} + allowUpdates: true + + draft-release: + runs-on: ubuntu-latest + needs: generate-release-body + if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }} steps: - name: Checkout uses: actions/checkout@v4 @@ -71,7 +98,10 @@ jobs: run: | echo PACKAGE_VERSION=`pdm show --version` >> $GITHUB_ENV - name: Release - uses: softprops/action-gh-release@v2 + uses: ncipollo/release-action@v1 with: body: ${{ needs.generate-release-body.outputs.release_body }} - tag_name: v${{ env.PACKAGE_VERSION }} + draft: true + updateOnlyUnreleased: true + tag: v${{ env.PACKAGE_VERSION }} + allowUpdates: true diff --git a/cliff.toml b/cliff.toml index 2429183..8bd3332 100644 --- a/cliff.toml +++ b/cliff.toml @@ -22,7 +22,7 @@ body = """ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} {% endif %}\ {% else %} - ## Latest Changes + ## What's Changed {% endif -%} {% for group, commits in commits | group_by(attribute="group") %} diff --git a/qqmusic_api/__init__.py b/qqmusic_api/__init__.py index 448ecfb..beb877f 100644 --- a/qqmusic_api/__init__.py +++ b/qqmusic_api/__init__.py @@ -5,7 +5,7 @@ from .utils.network import get_session, set_session from .utils.sync import sync -__version__ = "0.1.9" +__version__ = "0.1.10" logger = logging.getLogger("qqmusicapi")