From be2fc414fe2ec788edcc0891c2007be8ed5e0f35 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Wed, 21 Jun 2023 19:37:55 +0900 Subject: [PATCH] ci: replace 'create-release action' with gh cli --- .github/workflows/release.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e78c04e..9dd2136 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,13 @@ on: - master tags: - 'v*.*.*' + pull_request: + types: + - labeled jobs: release: + if: github.event.action != 'labeled' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -33,15 +37,19 @@ jobs: if_true: ${{ github.ref }} if_false: ${{ steps.bumpr.outputs.next_version }} - # Create release. - - uses: actions/create-release@v1 - if: "steps.tag.outputs.value != ''" + # Create release + - if: "steps.tag.outputs.value != ''" env: - # This token is provided by Actions, you do not need to create your own token + TAG_NAME: ${{ steps.tag.outputs.value }} + CURRENT: ${{ steps.bumpr.outputs.current_version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.tag.outputs.value }} - release_name: Release ${{ steps.tag.outputs.value }} - body: ${{ steps.bumpr.outputs.message }} - draft: false - prerelease: false + run: | + gh release create "${TAG_NAME}" -t "Release ${TAG_NAME/refs\/tags\//}" --generate-notes --notes-start-tag "${CURRENT}" + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@v1