From 1e2625a4602976689eb9fc3d85a4b0c2f024d434 Mon Sep 17 00:00:00 2001 From: skettiks Date: Sun, 3 May 2026 12:04:29 +0300 Subject: [PATCH] =?UTF-8?q?chore(ci):=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8E=20CI/CD=20=D0=BF=D0=B0=D0=B9=D0=BF?= =?UTF-8?q?=D0=BB=D0=B0=D0=B9=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 14 +++++++++----- .github/workflows/docker.yaml | 9 ++++++--- .github/workflows/release.yaml | 10 +++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) 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: