diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9561312..8cd8d59 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,8 @@ jobs: name: Build & Test runs-on: ubuntu-latest timeout-minutes: 20 + permissions: + contents: read outputs: artifact-name: ${{ steps.meta.outputs.artifact-name }} steps: @@ -28,23 +30,25 @@ jobs: - name: Set up Gradle uses: gradle/actions/setup-gradle@v6 - - name: Build - run: ./gradlew clean bootJar --stacktrace --no-daemon - - - name: Test - run: ./gradlew test --stacktrace --no-daemon + - name: Run CI quality gate + run: ./gradlew clean check bootJar --stacktrace --no-daemon - name: Set artifact name id: meta run: echo "artifact-name=build-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT" - name: Upload build artifacts + if: always() uses: actions/upload-artifact@v7 with: name: ${{ steps.meta.outputs.artifact-name }} path: | build/libs/*.jar + build/reports/detekt/** + build/reports/ktlint/** + build/reports/jacoco/** build/reports/** build/test-results/** + build/jacoco/** retention-days: 7 if-no-files-found: error diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 21e61b8..0854d36 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -30,13 +30,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Validate Dockerfile + - name: Build image (no push) if: inputs.push == false uses: docker/build-push-action@v7 with: context: . file: ./Containerfile - call: check + push: false + provenance: false + cache-from: type=gha + cache-to: type=gha,mode=max - name: Log in to GHCR if: inputs.push == true @@ -65,7 +68,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . - file: ./Dockerfile + file: ./Containerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 76f09cc..0fdfcb1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,9 +29,13 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} run: | - gh release create "${{ inputs.version }}" \ - --generate-notes \ - --title "${{ inputs.version }}" + if gh release view "${{ inputs.version }}" >/dev/null 2>&1; then + echo "Release ${{ inputs.version }} already exists. Skipping creation." + else + gh release create "${{ inputs.version }}" \ + --generate-notes \ + --title "${{ inputs.version }}" + fi - name: Send Telegram notification env: