From 36e315ea8b1750716fe81d7dd92f26ef455841dc Mon Sep 17 00:00:00 2001 From: YuLe Date: Sat, 4 Sep 2021 21:55:42 +0800 Subject: [PATCH] Add echo version & release action --- .github/release-drafter-config.yml | 31 +++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 20 +++++++++++++++++ gh-todo | 4 ++++ 3 files changed, 55 insertions(+) create mode 100644 .github/release-drafter-config.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter-config.yml b/.github/release-drafter-config.yml new file mode 100644 index 0000000..fcca4ea --- /dev/null +++ b/.github/release-drafter-config.yml @@ -0,0 +1,31 @@ +name-template: 'v$RESOLVED_VERSION 🌈' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..4b1cbd9 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,20 @@ +name: Release Drafter + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + types: [opened, reopened, labeled, synchronize] + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter-config.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/gh-todo b/gh-todo index 6e5d956..13505b3 100755 --- a/gh-todo +++ b/gh-todo @@ -18,6 +18,7 @@ Examples: EOF } +version="0.1.0" date=$(date -u +"%Y-%m-%d") repo="$(git config user.name)/todo" @@ -58,6 +59,9 @@ fi while [ $# -gt 0 ]; do case "$1" in + -v | --version) + echo $version + ;; -h | --help) help exit 0