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 | |
parent | 37a9f1b61cbdab30d6ea1853b7f6baf3cf2e3c98 (diff) |
ci: update release flowv0.43.3
-rw-r--r-- | .github/workflows/release.yml | 35 | ||||
-rw-r--r-- | .imgbotconfig | 7 | ||||
-rwxr-xr-x | release.sh | 42 |
3 files changed, 28 insertions, 56 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}" diff --git a/.imgbotconfig b/.imgbotconfig deleted file mode 100644 index a17fb067..00000000 --- a/.imgbotconfig +++ /dev/null @@ -1,7 +0,0 @@ -{ - "schedule": "daily", - "ignoredFiles": [ - "resources/*" - ], - "aggressiveCompression": "true" -} diff --git a/release.sh b/release.sh deleted file mode 100755 index c60b6c42..00000000 --- a/release.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# fail on unset variables and command errors -set -eu -o pipefail # -x: is for debugging - -function print_info() { - echo -e "\e[36mINFO: ${1}\e[m" -} - -if [ "$(git branch --show-current)" != "main" ]; then - echo "$0: Current branch is not main" 1>&2 - exit 1 -fi - -RELEASE_TYPE_LIST="prerelease prepatch patch preminor minor major premajor" -if command -v fzf; then - RELEASE_TYPE=$(echo "${RELEASE_TYPE_LIST}" | tr ' ' '\n' | fzf --layout=reverse) -else - select sel in ${RELEASE_TYPE_LIST}; do - RELEASE_TYPE="${sel}" - break - done -fi - -echo -e "$0: Create \e[36m${RELEASE_TYPE}\e[m release, continue? (y/n)" -read -r res -if [ "${res}" = "n" ]; then - echo "$0: Stop script" - exit 0 -fi - -git fetch origin -git pull origin main -git pull origin --tags - -npm ci -npm run build -npm run release -- --release-as "${RELEASE_TYPE}" --preset eslint - -TAG_NAME="v$(jq -r '.version' ./package.json)" -git push origin main -git push origin "${TAG_NAME}" |