Skip to content

Commit b761453

Browse files
authored
fix: do not push snapshots (#381)
publish to both github packages and central on a release <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Optimized the release workflow to streamline the publishing process for package deployment. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent faffa7d commit b761453

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

.github/workflows/release.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
AUTOMATION_KEY: ${{ secrets.AUTOMATION_KEY }}
2424
release:
2525
runs-on: ubuntu-latest
26+
if: startsWith(github.ref, 'refs/tags/')
2627
steps:
2728
- name: Checkout
2829
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -32,7 +33,6 @@ jobs:
3233
github_token: ${{ secrets.GITHUB_TOKEN }}
3334
# stage maven profile
3435
- name: Set up JDK to publish to GitHub Packages
35-
if: github.ref == 'refs/heads/main'
3636
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
3737
with:
3838
java-version: "17"
@@ -44,7 +44,6 @@ jobs:
4444
gpg-private-key: ${{ secrets.GPG_KEY }}
4545
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4646
- name: Publish to GitHub Packages
47-
if: github.ref == 'refs/heads/main'
4847
run: mvn --batch-mode deploy -DskipTests -P stage
4948
env:
5049
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
@@ -54,7 +53,6 @@ jobs:
5453
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
5554
# release maven profile
5655
- name: Set up JDK to publish to Maven Central
57-
if: startsWith(github.ref, 'refs/tags/')
5856
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
5957
with:
6058
java-version: "17"
@@ -66,7 +64,6 @@ jobs:
6664
gpg-private-key: ${{ secrets.GPG_KEY }}
6765
gpg-passphrase: MAVEN_GPG_PASSPHRASE
6866
- name: Publish to Maven Central
69-
if: startsWith(github.ref, 'refs/tags/')
7067
run: mvn --batch-mode deploy -DskipTests -P release
7168
env:
7269
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)