From 067c42aa9f66aab721ac6be60a449222418f3c0c Mon Sep 17 00:00:00 2001 From: Zac Kirksey Date: Fri, 5 Jun 2026 13:16:16 -0400 Subject: [PATCH] Push snapshot artifacts on master update --- .github/workflows/build.yml | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47ff0d5..66ace8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,3 +39,79 @@ jobs: name: coverage-reports path: '**/target/site/jacoco/' retention-days: 14 + + # Deploy artifacts (master only, in production) + deploy: + needs: [ build ] + if: | + always() && + github.event_name != 'pull_request' && + github.ref == 'refs/heads/master' && + needs.build.result == 'success' + runs-on: ubuntu-latest + environment: production + steps: + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + df -h + + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Create Maven Settings + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml < + + + codice-internal + github,codice-maven + https://repo.codice.org/repository/codice-internal/ + + + + + codice-internal + ${NEXUS_USERNAME} + ${NEXUS_PASSWORD} + + + codice-nexus + ${NEXUS_USERNAME} + ${NEXUS_PASSWORD} + + + github + ${NEXUS_USERNAME} + ${NEXUS_PASSWORD} + + + + EOF + + - name: Maven Deploy + run: | + RELEASES_URL="https://repo.codice.org/repository/maven-releases" + SNAPSHOTS_URL="https://repo.codice.org/repository/maven-snapshots" + echo "Deploying to Codice Nexus..." + mvn deploy -B \ + -DskipStatic=true \ + -DskipTests=true \ + -DretryFailedDeploymentCount=10 \ + -Dreleases.repository.url="$RELEASES_URL" \ + -Dsnapshots.repository.url="$SNAPSHOTS_URL" \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ No newline at end of file