updated pom.xml file #206
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: vertx-base | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: 'read' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Decode and Set up Google Cloud credentials | |
run: echo "${{ secrets.ARTIFACT_REGISTRY_KEY }}" | base64 -d > $HOME/gcloud-key.json | |
- name: Authenticate to Google Cloud | |
run: | | |
gcloud auth activate-service-account --key-file=$HOME/gcloud-key.json | |
gcloud config set project som-rit-infrastructure-prod | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Cache Maven dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Copy Maven settings | |
run: cp ./travis/new-settings.xml $HOME/.m2/settings.xml | |
- name: Update POM Version | |
run: sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml | |
- name: Run Maven Tests | |
run: mvn -e verify --settings $HOME/.m2/settings.xml | |
deploy_snapshots: | |
name: Deploy Snapshots | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: 'read' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Decode and Set up Google Cloud credentials | |
run: echo "${{ secrets.ARTIFACT_REGISTRY_KEY }}" | base64 -d > $HOME/gcloud-key.json | |
- name: Authenticate to Google Cloud | |
run: | | |
gcloud auth activate-service-account --key-file=$HOME/gcloud-key.json | |
gcloud config set project som-rit-infrastructure-prod | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Cache Maven dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Copy Maven settings for deploy | |
run: cp ./travis/new-settings.xml $HOME/.m2/settings.xml | |
- name: Update POM Version for deploy | |
run: sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml | |
- name: Generate Sources and Javadocs | |
run: mvn source:jar javadoc:jar | |
- name: List files before upload | |
run: ls target/ | |
- name: Deploy Snapshots with Retry Logic | |
run: | | |
success=false | |
for i in {1..5}; do | |
mvn -s $HOME/.m2/settings.xml \ | |
-Dmaven.wagon.http.retryHandler.count=5 \ | |
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \ | |
-Dmaven.wagon.http.timeout=7200000 \ | |
--batch-mode -e -DskipTests=true deploy -X && success=true && break || sleep 60; | |
done | |
if [ "$success" = false ]; then | |
echo "Maven deploy failed after 5 attempts." >&2 | |
exit 1 | |
fi |