Skip to content

Commit

Permalink
ci: 更新 release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luren-dc committed Nov 3, 2024
1 parent 299299b commit 73265ee
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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") %}
Expand Down
2 changes: 1 addition & 1 deletion qqmusic_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 73265ee

Please sign in to comment.