Skip to content

Commit

Permalink
NH-86008: update pipeline configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Oct 2, 2024
1 parent a82da42 commit b5b0c97
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
id-token: write

jobs:
publish:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -33,7 +33,12 @@ jobs:
echo "POM_VERSION=v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Publish package
run: mvn -s .github/m2/settings.xml -Dmaven.resolver.transport=wagon --batch-mode deploy
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
NEW_VERSION=${VERSION%%-SNAPSHOT}
mvn versions:set -DnewVersion=$NEW_VERSION
mvn -s .github/m2/settings.xml -Dmaven.resolver.transport=wagon --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Push

on:
push:

permissions:
packages: write
contents: write
id-token: write

jobs:
deploy-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: 8.0.302
distribution: 'temurin'

- name: Deploy snapshot
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
BRANCH=$(echo -n "${GITHUB_REF_NAME}" | sed -e 's/[^0-9a-zA-Z\._\-]/./g' | tr '[:upper:]' '[:lower:]')
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
NEW_VERSION=${VERSION%%-SNAPSHOT}-$BRANCH-$GIT_HASH-SNAPSHOT
mvn versions:set -DnewVersion=$NEW_VERSION
mvn -s .circleci/m2/settings.xml -T 8 deploy -DskipTests

0 comments on commit b5b0c97

Please sign in to comment.