summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorYulqen <246857+yulqen@users.noreply.github.com>2024-04-17 14:57:02 +0100
committerGitHub <noreply@github.com>2024-04-17 14:57:02 +0100
commitd1b8b8a2ea5495ce236bb9b57d617fabfce12822 (patch)
treeda9e647d1fe51f20971606ad4f9d8257a5790170 /.github
Initial commit
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/create_release.yml33
-rw-r--r--.github/workflows/pre_merge_check.yml19
2 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml
new file mode 100644
index 0000000..c7fdf5c
--- /dev/null
+++ b/.github/workflows/create_release.yml
@@ -0,0 +1,33 @@
+name: Create release
+
+on:
+ pull_request:
+ branches:
+ - main
+ types: [closed]
+
+jobs:
+ create_release:
+ name: Create release
+ if: github.event.pull_request.merged == true
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Check for the PR label
+ id: label
+ uses: zwaldowski/match-label-action@v4
+ with:
+ allowed: major,minor,patch
+ - name: Bump the version tag
+ id: next_version
+ uses: zwaldowski/semver-release-action@v3
+ with:
+ bump: ${{ steps.label.outputs.match }}
+ prefix: v
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Create release
+ id: create-release
+ uses: ncipollo/release-action@v1
+ with:
+ tag: v${{ steps.next_version.outputs.version }}
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/pre_merge_check.yml b/.github/workflows/pre_merge_check.yml
new file mode 100644
index 0000000..1740fb4
--- /dev/null
+++ b/.github/workflows/pre_merge_check.yml
@@ -0,0 +1,19 @@
+name: Pre-merge check
+
+on:
+ pull_request:
+ branches:
+ - main
+ types: [opened, reopened, synchronize, labeled]
+
+jobs:
+ check_pull_request_label:
+ name: Check pull request label
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Check for the PR label
+ id: label
+ uses: zwaldowski/match-label-action@v4
+ with:
+ allowed: major,minor,patch