cool #1
This file contains hidden or 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: Java Maven CI | |
| on: | |
| push: | |
| jobs: | |
| build: | |
| name: Maven Automation Build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [8.0.452+9] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: ${{ matrix.java }} | |
| # 缓存 Maven 本地仓库以提高速度 | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| # 可选:缓存 settings.xml 或其他配置 | |
| - name: Cache Maven install | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/settings.xml | |
| key: maven-settings | |
| - name: Build with Maven | |
| run: mvn -B -D style.color=always -D idea.version=2025.2 clean package | |
| - name: Upload Jar Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NRR-build-${{ github.sha }} | |
| path: | | |
| **/*.jar |