From c0c09fecbc9c18015ce888a7194c70795b88ddd2 Mon Sep 17 00:00:00 2001 From: mizaki Date: Wed, 18 Sep 2024 16:35:09 +0100 Subject: [PATCH] Update release.yaml --- .github/workflows/release.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2861ee5..6e7dc6f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,9 @@ name: CI on: - pull_request: push: - branches: - - '**' + tags: + - "[0-9]+.[0-9]+.[0-9]+*" jobs: build-and-publish: @@ -32,15 +31,20 @@ jobs: - name: Build and install wheel run: | tox run -m build - python -m pip install dist/*.whl -t build/plugin - cd build/plugin - mkdir ../../dist/plugin - zip -r ../../dist/plugin/${{ github.event.repository.name }}.zip * + python -m pip install dist/*.whl + + - name: Get release name + if: startsWith(github.ref, 'refs/tags/') + shell: bash + run: | + git fetch --depth=1 origin +refs/tags/*:refs/tags/* # github is dumb + echo "release_name=$(git tag -l --format "%(refname:strip=2): %(contents:lines=1)" ${{ github.ref_name }})" >> $GITHUB_ENV - name: Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + name: "${{ env.release_name }}" draft: false files: | dist/*.whl