diff options
author | peaceiris <30958501+peaceiris@users.noreply.github.com> | 2022-06-29 05:58:54 +0300 |
---|---|---|
committer | peaceiris <30958501+peaceiris@users.noreply.github.com> | 2022-06-29 05:58:54 +0300 |
commit | 47350571a95977cdd263845ca23b472113be867f (patch) | |
tree | 8c4dac3507d8516450d1cbba3b2ae38d2f72e076 /.github | |
parent | 37a9f1b61cbdab30d6ea1853b7f6baf3cf2e3c98 (diff) |
ci: update release flowv0.43.3
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/release.yml | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38b0a795..9789eb3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,21 +1,42 @@ name: Release on: - push: - tags: - - "v*.*.*" + workflow_dispatch: + inputs: + semver_type: + description: "Semver type" + required: true + type: "choice" + options: + - "patch" + - "minor" + # - "major" + default: "minor" jobs: main: runs-on: ubuntu-20.04 - timeout-minutes: 2 + timeout-minutes: 5 permissions: contents: write steps: - uses: actions/checkout@v3 - - uses: peaceiris/workflows/create-release-npm@v0.15.0 with: - draft: '' - prerelease: '' + fetch-depth: 0 + + - uses: peaceiris/workflows/setup-git@v0.14.1 + + - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + RELEASE_NOTES="./release_notes.md" + CURRENT_TAG=$(git describe --abbrev=0) + NEW_VERSION=$(npm_config_yes=true npx semver ${CURRENT_TAG} --increment ${{ github.event.inputs.semver_type }}) + NEW_TAG="v${NEW_VERSION}" + RELEASE_TITLE="Release ${NEW_TAG}" + git tag -a ${NEW_TAG} -m "${RELEASE_TITLE}" + git push origin ${NEW_TAG} + echo "See [CHANGELOG](https://github.com/peaceiris/playground-actions/compare/${CURRENT_TAG}...${NEW_TAG}) for more details." > "${RELEASE_NOTES}" + gh release create "${NEW_TAG}" --title "${RELEASE_TITLE}" --notes-file "${RELEASE_NOTES}" + rm "${RELEASE_NOTES}" |