Skip to content

Commit 2883784

Browse files
committed
ci: release SNAPSHOT version after merging PRs to v6
1 parent 6bc6811 commit 2883784

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/create-release.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
name: Create Release
22
on:
33
push:
4-
# run only on tags
4+
# Release a new version every time a v6 tag is pushed.
55
tags:
6-
- '**'
6+
- '6.0.0-*'
7+
pull_request:
8+
# Release a new SNAPSHOT version every time a PR is merged to v6.
9+
types: [closed]
10+
branches: ['v6']
711

812
jobs:
913
release:
1014
name: Deploy
11-
if: startsWith(github.ref, 'refs/tags')
15+
if: >
16+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
17+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
1218
runs-on: ubuntu-latest
1319
steps:
1420
- uses: actions/checkout@v4
@@ -39,7 +45,7 @@ jobs:
3945
retention-days: 1
4046
gh-release:
4147
name: Create a GitHub Release
42-
if: startsWith(github.ref, 'refs/tags')
48+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
4349
runs-on: ubuntu-latest
4450
needs: [ release ]
4551
steps:

0 commit comments

Comments
 (0)