diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml new file mode 100644 index 0000000000..25aa05453a --- /dev/null +++ b/.github/workflows/snapshot.yaml @@ -0,0 +1,36 @@ +--- + +name: Publish Snapshot + +on: + push: + branches: + - main + - '[0-9].x' + workflow_dispatch: + +jobs: + + snapshot: + name: Deploy Snapshot + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up publishing to maven central + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: mvn offline + run: | + mvn -q dependency:go-offline + - name: deploy + run: | + mvn --no-transfer-progress deploy + env: + MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}} + MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/version-and-release.yaml b/.github/workflows/version-and-release.yaml new file mode 100644 index 0000000000..7f0fa2cd74 --- /dev/null +++ b/.github/workflows/version-and-release.yaml @@ -0,0 +1,47 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: get version from tag + id: get_version + run: | + realversion="${GITHUB_REF/refs\/tags\//}" + realversion="${realversion//v/}" + echo "VERSION=$realversion" >> $GITHUB_OUTPUT + + - name: Set up publishing to maven central + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: mvn versions + run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }} + + - name: Install gpg key + run: | + cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Publish + run: | + mvn --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \ + deploy -P release + env: + MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}} + MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}} \ No newline at end of file diff --git a/pom.xml b/pom.xml index c47316c90a..015cd8ccaa 100644 --- a/pom.xml +++ b/pom.xml @@ -89,12 +89,12 @@ - sonatype-nexus-snapshots + ossrh Sonatype Nexus Snapshots https://oss.sonatype.org/content/repositories/snapshots/ - sonatype-nexus-staging + ossrh Nexus Release Repository https://oss.sonatype.org/service/local/staging/deploy/maven2/