Skip to content

added BinaryHandlerPeriod #202

added BinaryHandlerPeriod

added BinaryHandlerPeriod #202

name: Make branch snapshot and deploy
on:
push:
branches-ignore:
- main
- 'release/**'
jobs:
publish:
if: github.repository == 'eclipse-serializer/serializer'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Snapshot Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Prepare suffix
run: |
suffix=$(echo -n "${GITHUB_REF#refs/heads/}" | tr '/' '_' | cut -c1-10)-$(echo -n "${GITHUB_REF#refs/heads/}" | md5sum | cut -c1-10)
echo "Suffix: $suffix"
echo "SUFFIX=$suffix" >> $GITHUB_ENV
- name: Update project version
run: |
currentVersion=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
newVersion="${currentVersion%-SNAPSHOT}-$SUFFIX-SNAPSHOT"
mvn versions:set -DnewVersion=$newVersion --batch-mode
- name: Make a snapshot
run: mvn -Pdeploy -Pproduction --no-transfer-progress --batch-mode clean deploy
env:
MAVEN_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
publish_java17:
if: github.repository == 'eclipse-serializer/serializer'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Snapshot Repository (Java 17)
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Prepare suffix
run: |
suffix=$(echo -n "${GITHUB_REF#refs/heads/}" | tr '/' '_' | cut -c1-10)-$(echo -n "${GITHUB_REF#refs/heads/}" | md5sum | cut -c1-10)
echo "Suffix: $suffix"
echo "SUFFIX=$suffix" >> $GITHUB_ENV
- name: Update project version
run: |
currentVersion=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
newVersion="${currentVersion%-SNAPSHOT}-$SUFFIX-SNAPSHOT"
mvn versions:set -DnewVersion=$newVersion --batch-mode
- name: Build with Java 17
run: |
mvn -Pproduction -pl persistence/binary-jdk17 clean install -am -B
- name: Deploy module build with Java 17
run: |
mvn -Pdeploy -Pproduction -pl persistence/binary-jdk17 clean deploy
env:
MAVEN_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}