Skip to content

Commit

Permalink
ci: update release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Jun 29, 2022
1 parent 37a9f1b commit 4735057
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 56 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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}"
7 changes: 0 additions & 7 deletions .imgbotconfig

This file was deleted.

42 changes: 0 additions & 42 deletions release.sh

This file was deleted.

0 comments on commit 4735057

Please sign in to comment.