aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml34
1 files changed, 18 insertions, 16 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 878e5d2..57fbcc4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,29 +1,31 @@
+name: Create Release on Version Update
+
on:
push:
- # Sequence of patterns matched against refs/tags
- tags:
- - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
-
-name: Create Release
+ branches:
+ - main
jobs:
- build:
- name: Create Release
+ create_release:
runs-on: ubuntu-latest
+
steps:
- - name: Checkout code
- uses: actions/checkout@v2
+ - name: Check commit message and version
+ id: check_version
+ run: |
+ commit_message=$(git log -1 --pretty=format:%s)
+ version=$(echo $commit_message | grep -o -E "v[0-9]+\.[0-9]+\.[0-9]+" || true)
+ echo "Version found in commit message: $version"
+ echo "::set-output name=version::$version"
+ shell: bash
+
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- tag_name: ${{ github.ref }}
- release_name: Release ${{ github.ref }}
- body: |
- Changes in this Release
- - First Change
- - Second Change
+ tag_name: ${{ steps.check_version.outputs.version }}
+ release_name: Release ${{ steps.check_version.outputs.version }}
draft: false
prerelease: false