Skip to content

Reset version to 1.0 #10

Reset version to 1.0

Reset version to 1.0 #10

Workflow file for this run

name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '21' ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Configure Git for version bumps
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config user.name "Version Bump"
git config user.email "version-bump@flossware.org"
- name: Auto-increment version
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mvn -U build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion} versions:commit
- name: Build with Maven
run: mvn -B clean verify
- name: Run tests
run: mvn -B test
- name: Commit and tag version
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
git add pom.xml
git commit -m "Automated Version Bump ${VERSION} [ci skip]"
git tag "${VERSION}"
git push origin main --tags
- name: Generate test report
if: always()
run: mvn surefire-report:report-only
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-java-${{ matrix.java }}
path: target/surefire-reports/
retention-days: 30
code-quality:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: OWASP Dependency Check
run: mvn org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=7
continue-on-error: true
- name: Upload OWASP Report
if: always()
uses: actions/upload-artifact@v4
with:
name: dependency-check-report
path: target/dependency-check-report.html
retention-days: 30