Skip to content

Commit f6eedf2

Browse files
aksOpsclaude
andcommitted
build: switch from beta releases to SNAPSHOT deploys
- Renamed workflow: Beta Release → Snapshot Deploy - Version stays 0.1.0-SNAPSHOT in pom.xml (no auto-increment) - Deploys to OSSRH snapshots (not Maven Central) - No GPG signing needed for SNAPSHOTs - No git tags, no GitHub releases - SNAPSHOTs can be overwritten freely without polluting Maven Central - Stable releases still use release-java.yml with GPG + Central Portal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 53e7b6f commit f6eedf2

2 files changed

Lines changed: 13 additions & 47 deletions

File tree

.github/workflows/beta-java.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
name: Beta Release (Java)
1+
name: Snapshot Deploy (Java)
22
on:
33
push:
44
branches: [java]
55
paths: ['src/**', 'pom.xml']
66
workflow_dispatch:
77

88
jobs:
9-
beta:
9+
snapshot:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: write
12+
contents: read
1313
packages: write
1414
steps:
1515
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
1816

1917
- uses: actions/setup-java@v4
2018
with:
@@ -24,52 +22,12 @@ jobs:
2422
server-id: central
2523
server-username: MAVEN_USERNAME
2624
server-password: MAVEN_PASSWORD
27-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28-
29-
- name: Determine beta version
30-
id: version
31-
run: |
32-
LATEST_BETA=$(git tag -l 'v0.0.1-beta.*' | sort -V | tail -1)
33-
if [ -z "$LATEST_BETA" ]; then
34-
NEXT_NUM=0
35-
else
36-
CURRENT_NUM=$(echo "$LATEST_BETA" | grep -oP 'beta\.\K[0-9]+')
37-
NEXT_NUM=$((CURRENT_NUM + 1))
38-
fi
39-
VERSION="0.0.1-beta.${NEXT_NUM}"
40-
echo "version=$VERSION" >> $GITHUB_OUTPUT
41-
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
42-
echo "Next beta version: $VERSION"
43-
44-
- name: Set version in pom.xml
45-
env:
46-
BETA_VERSION: ${{ steps.version.outputs.version }}
47-
run: mvn versions:set -DnewVersion="$BETA_VERSION" -B
4825

4926
- name: Build and test
5027
run: mvn clean verify -B
5128

52-
- name: Deploy to Maven Central
29+
- name: Deploy SNAPSHOT to OSSRH
5330
env:
5431
MAVEN_USERNAME: ${{ secrets.OSS_NEXUS_USER }}
5532
MAVEN_PASSWORD: ${{ secrets.OSS_NEXUS_PASS }}
56-
run: mvn deploy -DskipTests -B
57-
58-
- name: Create git tag
59-
env:
60-
BETA_TAG: ${{ steps.version.outputs.tag }}
61-
BETA_VERSION: ${{ steps.version.outputs.version }}
62-
run: |
63-
git config user.name "github-actions[bot]"
64-
git config user.email "github-actions[bot]@users.noreply.github.com"
65-
git tag -a "$BETA_TAG" -m "Beta release $BETA_VERSION"
66-
git push origin "$BETA_TAG"
67-
68-
- name: Create GitHub Release
69-
uses: softprops/action-gh-release@v2
70-
with:
71-
tag_name: ${{ steps.version.outputs.tag }}
72-
name: "Beta ${{ steps.version.outputs.version }}"
73-
prerelease: true
74-
generate_release_notes: true
75-
files: target/code-iq-*.jar
33+
run: mvn deploy -DskipTests -Dgpg.skip=true -B

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
<checkstyle-plugin.version>3.6.0</checkstyle-plugin.version>
3333
</properties>
3434

35+
<!-- SNAPSHOTs go to OSSRH, releases go via Central Publishing Plugin -->
36+
<distributionManagement>
37+
<snapshotRepository>
38+
<id>central</id>
39+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
40+
</snapshotRepository>
41+
</distributionManagement>
42+
3543
<dependencyManagement>
3644
<dependencies>
3745
<dependency>

0 commit comments

Comments
 (0)