diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index 4e19ccaf..ba3bc04a 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: releaseVersion: - description: 'Release and tag version' + description: 'Release version (e.g., 2.0.0, 2.0.0-M1, 2.0.0-RC1)' required: true - default: "1.5.0" + default: "2.0.0" developmentVersion: description: 'Version to use for new working copy' required: true @@ -33,6 +33,16 @@ jobs: git config user.email "actions@github.com" git config user.name "GitHub Actions" + - name: Validate version format + run: | + VERSION="${{ github.event.inputs.releaseVersion }}" + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+|-RC[0-9]+)?$ ]]; then + echo "Error: Version '$VERSION' does not match valid pattern" + echo "Expected formats: X.Y.Z, X.Y.Z-MN, or X.Y.Z-RCN" + exit 1 + fi + echo "Version '$VERSION' is valid" + - name: Run release release.yml env: GITHUB_ACTOR: ${{ github.actor }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed364830..352afbbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,11 +3,13 @@ name: Publish Release to Maven Central on: push: tags: - - '*' + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-M[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-RC[0-9]+' workflow_dispatch: inputs: tag: - description: 'Tag to checkout and publish' + description: 'Tag to checkout and publish (e.g., 2.0.0, 2.0.0-M1, 2.0.0-RC1)' required: true type: string @@ -20,6 +22,16 @@ jobs: with: ref: ${{ inputs.tag }} + - name: Validate tag format + run: | + TAG="${{ github.ref_name || inputs.tag }}" + if [[ ! "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+|-RC[0-9]+)?$ ]]; then + echo "Error: Tag '$TAG' does not match valid version pattern" + echo "Expected formats: X.Y.Z, X.Y.Z-MN, or X.Y.Z-RCN" + exit 1 + fi + echo "Tag '$TAG' is valid" + - name: Set up JDK 17 uses: actions/setup-java@v5 with: diff --git a/RELEASING.md b/RELEASING.md index 02128d13..601c95b8 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,5 +1,18 @@ # Release Process for Tarantool Java SDK +## Version Types + +We use the following version formats: + +| Type | Format | Example | Description | +|------|--------|---------|-------------| +| Final Release | `X.Y.Z` | `2.0.0` | Production-ready release | +| Milestone | `X.Y.Z-MN` | `2.0.0-M1` | Early preview for testing | +| Release Candidate | `X.Y.Z-RCN` | `2.0.0-RC1` | Pre-release for final validation | +| Development | `X.Y.Z-dev.N` | `2.0.0-dev.1` | Internal development builds (not for Maven Central) | + +## Release Steps + Follow these steps to prepare and publish a new release: 1. **Update JavaDoc and Project Documentation** @@ -20,7 +33,9 @@ Follow these steps to prepare and publish a new release: 4. **Run the "Prepare Release" Workflow** - After the PR is merged, trigger the "Prepare Release" workflow (using Maven Release Plugin) to prepare the release. + - Enter the release version (e.g., `2.0.0`, `2.0.0-M1`, or `2.0.0-RC1`) and the next development version. - This will update versions, tag the release, and push changes to the repository. + - **For Milestones and RCs**: The tag will trigger the release workflow automatically. After publishing to Maven Central, mark the GitHub release as "Pre-release". 5. **Publish Artifacts to Maven Central** - Once the workflow completes successfully, go to Maven Central and publish the release from the service account. diff --git a/pom.xml b/pom.xml index 996b397c..1eb551f1 100644 --- a/pom.xml +++ b/pom.xml @@ -64,9 +64,9 @@ - scm:git:https://github.com/tarantool/tarantool-java-sdk.git - scm:git:https://github.com/tarantool/tarantool-java-sdk.git - scm:git:https://github.com/tarantool/tarantool-java-sdk.git + scm:git:git@github.com:tarantool/tarantool-java-sdk.git + scm:git:git@github.com:tarantool/tarantool-java-sdk.git + https://github.com/tarantool/tarantool-java-sdk.git HEAD