Skip to content

Commit 0494b45

Browse files
authored
Merge pull request #1616 from microsoftgraph/fix/mvn-central-release
Trigger maven central release on tag creation
2 parents 521e669 + 16b78ad commit 0494b45

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ name: Build and Publish
22

33
on:
44
push:
5-
branches: [main, support/2.x.x]
5+
branches: [main]
66
paths-ignore:
77
- '.gradle/wrapper'
88
- '.gitignore'
99
- 'LICENSE'
1010
- 'THIRD PARTY NOTICES'
1111
- '*.md'
12+
tags:
13+
- "v[0-9]+.[0-9]+.[0-9]+"
1214
env:
1315
PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository
1416
PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository
@@ -47,7 +49,7 @@ jobs:
4749
run: ./gradlew $PREVIEW_TASK
4850

4951
maven_Release:
50-
if: ${{ github.ref == 'refs/heads/main' }}
52+
if: startsWith(github.ref, 'refs/tags/')
5153
environment:
5254
name: maven_central_release
5355
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)