Repository navigation
chore(ci): add gha linter (zizmore) and fix issues #1781
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: CI/CD | |
| permissions: {} | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| zizmor: | |
| name: zizmor | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0 | |
| with: | |
| advanced-security: false # Fail the job on findings instead of uploading SARIF. | |
| annotations: true | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| version: [17, 21, 25] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install java | |
| uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '${{ matrix.version }}' | |
| cache: 'gradle' | |
| - name: Check code format | |
| run: ./gradlew spotlessCheck | |
| - name: Lint | |
| run: make lint | |
| - name: Test | |
| run: make test | |
| - name: Build | |
| run: make build | |
| - name: Publish to local maven repo | |
| run: make install | |
| cd: | |
| name: CD | |
| runs-on: ubuntu-latest | |
| if: ${{ github.ref_name == 'main' }} | |
| needs: [ci, zizmor] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| # we need to fetch all existing git tags | |
| fetch-depth: 0 | |
| # Required to push release tags from scripts/publish.sh. | |
| persist-credentials: true | |
| - name: Create git tags and publish to Maven Central | |
| env: | |
| GPG_SIGNING_KEY: "${{ secrets.GPG_SIGNING_KEY }}" | |
| GPG_SIGNING_PASSWORD: "${{ secrets.GPG_SIGNING_PASSWORD }}" | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: "${{ secrets.MAVEN_CENTRAL_USERNAME }}" | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: "${{ secrets.MAVEN_CENTRAL_PASSWORD }}" | |
| run: | | |
| git config --global user.name "SDK Releaser Bot" | |
| git config --global user.email "noreply@stackit.de" | |
| ./scripts/publish.sh | |