From d62abbd204c384d745bb7a4ef1bcaa03dd62ecd2 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Sat, 9 Sep 2023 18:37:40 +0900 Subject: [PATCH] ci: replace 'create-release action' with gh cli (#68) * ci: replace 'create-release action' with gh cli * Update .github/workflows/release.yml Co-authored-by: Shoma Okamoto <32533860+shmokmt@users.noreply.github.com> --------- Co-authored-by: Shoma Okamoto <32533860+shmokmt@users.noreply.github.com> --- .github/workflows/release.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3188ff9..d8365cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,14 +1,17 @@ name: release - on: push: branches: - master tags: - - 'v*.*.*' + - "v*.*.*" + pull_request: + types: + - labeled jobs: release: + if: github.event.action != 'labeled' runs-on: ubuntu-latest steps: @@ -35,15 +38,20 @@ 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: + TAG_NAME: ${{ steps.tag.outputs.value }} + BODY: ${{ steps.bumpr.outputs.message }} # This token is provided by Actions, you do not need to create your own token 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\//}" --notes "${BODY}" + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@v1