Skip to content

Commit 6c13f56

Browse files
authored
feat: update cicd for auto pull request version bump (#8)
1 parent 1a30660 commit 6c13f56

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
name: Release Workflow
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version_type:
7-
description: "Version bump type"
8-
required: true
9-
default: "patch"
10-
type: choice
11-
options:
12-
- patch
13-
- minor
14-
- major
15-
4+
push:
5+
branches: [main]
166
pull_request:
177
types: [closed]
188

199
jobs:
2010
create_release_pr:
2111
name: Create Release PR
22-
if: github.event_name == 'workflow_dispatch'
12+
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'chore: release')
2313
runs-on: ubuntu-latest
2414
steps:
2515
- name: Checkout code
@@ -34,7 +24,8 @@ jobs:
3424
id: version
3525
run: |
3626
CURRENT_VERSION=$(jq -r '.version' deno.json)
37-
VERSION_TYPE=${{ github.event.inputs.version_type }}
27+
# Default to patch bump
28+
VERSION_TYPE="patch"
3829
3930
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
4031
MAJOR=${VERSION_PARTS[0]}
@@ -80,7 +71,7 @@ jobs:
8071
branch: "release/${{ steps.version.outputs.tag }}"
8172
labels: "release"
8273

83-
test:
74+
test:
8475
name: Test Deno
8576
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
8677
runs-on: ubuntu-latest
@@ -240,7 +231,7 @@ jobs:
240231
run: |
241232
curl -X POST "https://api.deno.land/webhook/gh/lingodotdev/sdk-deno" \
242233
-H "Content-Type: application/json" \
243-
-d '{
234+
-d '{
244235
"ref": "${{ github.ref }}",
245236
"repository": {
246237
"full_name": "lingodotdev/sdk-deno"
@@ -297,4 +288,4 @@ jobs:
297288
fi
298289
echo ""
299290
echo "🚀 Installation:"
300-
echo " deno add @lingodotdev/deno-sdk"
291+
echo " deno add @lingodotdev/deno-sdk"

0 commit comments

Comments
 (0)