diff --git a/.github/workflows/ci-publish-commit.yml b/.github/workflows/ci-publish-commit.yml new file mode 100644 index 0000000000..9439cc4bd7 --- /dev/null +++ b/.github/workflows/ci-publish-commit.yml @@ -0,0 +1,71 @@ +# Copyright 2022 JanusGraph Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: CI Release commit artifacts publish to `org.janusgraph.commit` groupId + +on: + push: + branches: + - master + - v* + +jobs: + commit-publish: + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.312+7' + java-package: jdk + - name: Remove version SNAPSHOT suffix if exists + run: mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false + - name: Set JanusGraph version environment variable + run: | + export JG_VER="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$(date '+%Y%m%d-%H%M%S').$(git rev-parse --short HEAD)" + export JG_DESCRIPTION="Janusgraph commit release. Commit $(git rev-parse HEAD). Branch $(git rev-parse --abbrev-ref HEAD). Version $JG_VER." + echo "JG_VER=${JG_VER}" >> $GITHUB_ENV + echo "JG_DESCRIPTION=${JG_DESCRIPTION}" >> $GITHUB_ENV + - name: Configure GPG Key + run: | + echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import + env: + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + - name: Set OSSR credentials + run: | + mkdir -p ~/.m2/ + echo "$MASTER_PASSWORD" > ~/.m2/settings-security.xml + echo "ossrh$OSSRH_USERNAME$OSSRH_PASSWORD" > ~/.m2/settings.xml + env: + MASTER_PASSWORD: ${{ secrets.MASTER_PASSWORD }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + - name: Replace groupId to commit groupId + run: find ./ -type f -name "pom.xml" -exec sed -i "s/org.janusgraph<\/groupId>/org.janusgraph.commit<\/groupId>/g" {} \; + - name: Setup unique version + run: mvn versions:set -DnewVersion="$JG_VER" -DgenerateBackupPoms=false + - name: Make JanusGraph JAR artifacts + run: mvn clean install -Pjanusgraph-release -DskipTests=true + - name: Deploy JanusGraph JAR artifacts into staging repository + run: mvn deploy -Pjanusgraph-release,janusgraph-commit-release -DskipTests=true -DautoReleaseAfterClose=true -Ddescription="$JG_DESCRIPTION" -DstagingDescription="$JG_DESCRIPTION" diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish-official.yml similarity index 98% rename from .github/workflows/ci-publish.yml rename to .github/workflows/ci-publish-official.yml index bd20b086ce..799206d1a9 100644 --- a/.github/workflows/ci-publish.yml +++ b/.github/workflows/ci-publish-official.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: CI Release artifacts publish +name: CI Release artifacts publish to `org.janusgraph` groupId on: push: diff --git a/docs/advanced-topics/commit-releases.md b/docs/advanced-topics/commit-releases.md new file mode 100644 index 0000000000..6ac13df152 --- /dev/null +++ b/docs/advanced-topics/commit-releases.md @@ -0,0 +1,75 @@ +# Snapshot releases + +In addition to official JanusGraph releases, JanusGraph publishes +releases for each commit. The commit releases allow users to use latest +JanusGraph features without relying on official JanusGraph releases. +- Official JanusGraph releases are better tested and usually come with finalized + changes which signals that the used features are most likely to be stable for long term. +- Commit releases are not manually verified but instead verified by main CI tests as + well as scheduled full CI tests (once per week). New features in commit releases are not + guaranteed to be compatible between commits. Thus, you may expect more breaking changes between + commit releases and official releases. + +## Maven repository artifacts + +Both official and commit release are deployed to Sonatype OSS and are available in Sonatype Maven Central Repository +under different group ids. + +Official JanusGraph releases have the next groupId: `org.janusgraph`. +Dependencies example: +```xml tab='Maven' + + org.janusgraph + janusgraph-core + 0.6.2 + +``` + +```groovy tab='Gradle' +compile "org.janusgraph:janusgraph-core:0.6.2" +``` + +Commit JanusGraph releases have the next groupId: `org.janusgraph.commit`. +Artifact id for commit releases have the next format: `FOLLOWING_VERSION-DATE-TIME.COMMIT`. +- `FOLLOWING_VERSION` is the upcoming official version to be used after release is finalized (i.e. `0.6.3` if the current latest release is `0.6.2`). +- `DATE` - date of the commit release in `yyyyMMdd` format. +- `TIME` - time of the commit release in `HHmmss` format. +- `COMMIT` - short commit hash of the commit used in the release. + +Dependencies example: +```xml tab='Maven' + + org.janusgraph.commit + janusgraph-core + 0.6.3-20221207-100250.39839b810 + +``` + +```groovy tab='Gradle' +compile "org.janusgraph.commit:janusgraph-core:0.6.3-20221207-100250.39839b810" +``` + +## JanusGraph distribution builds + +In addition to distribution builds provided for each official JanusGraph release, snapshot distribution builds are +provided for all commits. + +!!! info +GitHub allows to download distribution builds only for authenticated GitHub users. + +To access the distribution build bundle for any commit, please open the commit you are interested in and select its +`CI Release` details. For example: +![](github_release_ci.png) + +When `CI Release` page is opened for a specific commit, open summary and download the attached to `Artifacts` section +file named `distribution-builds`. This will download `distribution-builds.zip` archive containing all distribution builds. +![](github_distribution_builds.png) + +!!! warning +Old snapshot distribution builds are expiring in GitHub due to timing and memory limits. It's not guaranteed that +the snapshot distribution build downloaded yesterday is available today. We encourage to use either official release +distribution builds or newer snapshot distribution builds. + +If you see expired distribution builds or don't see any distribution builds for a specific commit, it means that it isn't +available to be downloaded anymore. Thus, the distribution builds from newer commits should be used. +![](github_expired_distribution_builds.png) diff --git a/docs/advanced-topics/github_distribution_builds.png b/docs/advanced-topics/github_distribution_builds.png new file mode 100644 index 0000000000..843e7ec110 Binary files /dev/null and b/docs/advanced-topics/github_distribution_builds.png differ diff --git a/docs/advanced-topics/github_expired_distribution_builds.png b/docs/advanced-topics/github_expired_distribution_builds.png new file mode 100644 index 0000000000..ab5241a0a1 Binary files /dev/null and b/docs/advanced-topics/github_expired_distribution_builds.png differ diff --git a/docs/advanced-topics/github_release_ci.png b/docs/advanced-topics/github_release_ci.png new file mode 100644 index 0000000000..1de3954e39 Binary files /dev/null and b/docs/advanced-topics/github_release_ci.png differ diff --git a/docs/development.md b/docs/development.md index 8cdcf9cfaf..6400e5f181 100644 --- a/docs/development.md +++ b/docs/development.md @@ -156,59 +156,6 @@ To build JanusGraph you need [git](http://git-scm.com/) and Note, that running the comprehensive test suite requires a significant amount of of time (> 1 hour). -### Depending on JanusGraph Snapshots - -For developing against the most current version of JanusGraph, depend on -JanusGraph snapshot releases. Note, that these releases are development -releases and therefore unstable and likely to change. Unless one is -interested in the most recent development status of JanusGraph, we -recommend to use the stable JanusGraph release instead. - -=== "Maven" - ```xml - - org.janusgraph - janusgraph-core - {{ snapshot_version }} - - ``` - -=== "Gradle" - ```groovy - compile "org.janusgraph:janusgraph-core:{{ snapshot_version }}" - ``` - -Check the [master branch](https://github.com/JanusGraph/janusgraph/tree/master) for the -most current release version. SNAPSHOTs will be available through the -[Sonatype repository](https://oss.sonatype.org/content/repositories/snapshots/org/janusgraph/). - -When adding this dependency, be sure to add the following repository to build file: - -=== "Maven" - ```xml - - ossrh - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - ``` - -=== "Gradle" - ```groovy - maven { - url "https://oss.sonatype.org/content/repositories/snapshots" - mavenContent { - snapshotsOnly() - } - } - ``` - ### FAQs **Maven build causes dozens of "\[WARNING\] We have a duplicate…" diff --git a/mkdocs.yml b/mkdocs.yml index d785e69825..6fb131f525 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -161,6 +161,7 @@ nav: - JanusGraph Bus: advanced-topics/janusgraph-bus.md - ExecutorService: advanced-topics/executor-service.md - Technical Limitations: advanced-topics/technical-limitations.md + - Snapshot Releases: advanced-topics/commit-releases.md - Common Questions: common-questions.md - Development: development.md - Changelog: changelog.md diff --git a/pom.xml b/pom.xml index 3a06bb3ec5..b90d2077e2 100644 --- a/pom.xml +++ b/pom.xml @@ -1518,6 +1518,26 @@ + + janusgraph-commit-release + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + + https://oss.sonatype.org + + ossrh + + + + + + coverage