Skip to content

Commit 5077615

Browse files
committed
auto release and bump on merge to main
1 parent 76d01ea commit 5077615

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Release Docker Image
22

33
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'rust/**'
8+
- 'docker/**'
9+
- '.github/workflows/release.yml'
10+
- '.github/workflows/docker-build.yml'
411
workflow_dispatch:
512
inputs:
613
bump:
@@ -26,6 +33,7 @@ permissions:
2633

2734
jobs:
2835
version:
36+
if: github.actor != 'github-actions[bot]'
2937
runs-on: ubuntu-latest
3038
outputs:
3139
version: ${{ steps.new.outputs.version }}
@@ -44,7 +52,9 @@ jobs:
4452
CURRENT="$(tr -d '[:space:]' < VERSION)"
4553
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
4654
47-
case "${{ inputs.bump }}" in
55+
BUMP="${{ inputs.bump || 'patch' }}"
56+
57+
case "$BUMP" in
4858
major)
4959
NEW_VERSION="$((MAJOR + 1)).0.0"
5060
;;
@@ -57,6 +67,10 @@ jobs:
5767
custom)
5868
NEW_VERSION="${{ inputs.custom_version }}"
5969
;;
70+
*)
71+
echo "Invalid bump type: $BUMP" >&2
72+
exit 1
73+
;;
6074
esac
6175
6276
if [[ ! "$NEW_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then

0 commit comments

Comments
 (0)