correct reading of ar key #185
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 | |
strategy: | |
matrix: | |
java-version: [17] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java-version }} | |
- name: Cache Maven dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Decode and Copy Maven settings | |
run: | | |
echo "${{ secrets.ARTIFACT_REGISTRY_KEY }}" | base64 --decode > artifact_registry_key.json | |
cp ./travis/new-settings.xml $HOME/.m2/settings.xml | |
# Use @ as the sed delimiter to avoid issues with slashes in the JSON key | |
sed -i 's@${env.ARTIFACT_REGISTRY_KEY}@'$(cat artifact_registry_key.json)'@' $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 | |
- name: Surefire Reports on Failure | |
if: failure() | |
run: | | |
echo "\n=== SUREFIRE REPORTS ===\n" | |
for F in target/surefire-reports/*.txt; do echo $F; cat $F; echo; done | |
deploy_snapshots: | |
name: Deploy Snapshots | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- 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: Decode and Copy Maven settings for deploy | |
run: | | |
echo "${{ secrets.ARTIFACT_REGISTRY_KEY }}" | base64 --decode > artifact_registry_key.json | |
cp ./travis/new-settings.xml $HOME/.m2/settings.xml | |
# Use @ as the sed delimiter to avoid issues with slashes in the JSON key | |
sed -i 's@${env.ARTIFACT_REGISTRY_KEY}@'$(cat artifact_registry_key.json)'@' $HOME/.m2/settings.xml | |
- name: Update POM Version for deploy | |
run: sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml | |
- name: Deploy Snapshots | |
run: mvn -s $HOME/.m2/settings.xml -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -e -DskipTests=true deploy |