From 2e7e073f9359194af9d9b6922903374815030126 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sun, 8 Nov 2026 16:10:40 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20Gitea=20=EB=8B=A8=EA=B3=84=20workflow=20?= =?UTF-8?q?=EB=84=B7(pr=C2=B7main=C2=B7release=C2=B7signing-check)?= =?UTF-8?q?=EC=9D=84=20=EB=8D=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 이 repo에는 아직 CI가 없다. 템플릿에서는 메시징 모듈이 템플릿 PR·main workflow와 별도 messaging-certification.yml(주 1회, 메시징 경로 변경 때)로 검사받았다. 분리한 뒤에는 이 repo가 자기 변경을 스스로 막아야 한다. grpc-library와 같은 단계 파일 넷을 둔다. job은 Gradle 단계 한 줄이다. - pr.yml: ./gradlew ci, 그리고 verifyStrictLaneStages --dry-run. - main.yml: ./gradlew mainCheck(main push와 매일 03:30 KST). 브로커 인증 lane과 증거 게이트가 여기 들어 있어, 템플릿의 주 1회보다 자주 실제 Kafka로 인증 증거를 다시 만든다. 밤 실행은 같은 runner의 grpc-library(03:00)와 30분 떨어뜨렸다. - release.yml: vX.Y.Z 태그에서 releaseCheck release(검사가 끝난 뒤에만 배포). secret PACKAGE_TOKEN·SIGNING_KEY·SIGNING_PASSWORD. - signing-check.yml: 수동. 서명 secret을 값 없이 진단한다. pr·main의 checkout에서 fetch-depth: 0을 뺐다. grpc-library는 Buf 비교 기준 때문에 이력 전체가 필요했지만 이 repo에는 이력을 읽는 검사가 없다. 위험: 첫 main 실행이 runner에서 인증 lane을 처음 돌린다. 템플릿에서는 desktop에서만 돌았다. 검증: 아직 runner에서 돌리지 않았다(push 뒤 pr·main 실행으로 본다). Refs: design-docs repo-structure/05-library-repos.md 7.1절 --- .gitea/workflows/main.yml | 35 +++++++++++++++++++++++++ .gitea/workflows/pr.yml | 29 +++++++++++++++++++++ .gitea/workflows/release.yml | 42 ++++++++++++++++++++++++++++++ .gitea/workflows/signing-check.yml | 29 +++++++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 .gitea/workflows/main.yml create mode 100644 .gitea/workflows/pr.yml create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitea/workflows/signing-check.yml diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml new file mode 100644 index 0000000..defd459 --- /dev/null +++ b/.gitea/workflows/main.yml @@ -0,0 +1,35 @@ +# Main-branch stage, on every push to main and nightly. The job is the Gradle stage `mainCheck`: +# `ci` again on the merged commit, plus the lanes that start containers (integrationCheck) and the +# broker certification gate (verifyMessagingCertificationEvidence: the committed manifest claims what +# this run proved against a live Kafka). Docker comes from the runner (desktop-runner, +# docker-in-docker). The certification lane writes GITHUB_SHA into every evidence line it produces. +name: main + +on: + push: + branches: [main] + schedule: + # 03:30 KST, half an hour after grpc-library's nightly run on the same runner. + - cron: "30 18 * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + main-check: + runs-on: ubuntu-latest + timeout-minutes: 90 + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: https://github.com/actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: temurin + java-version: "21.0.11+10.0.LTS" + - uses: https://github.com/gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6 + with: + build-scan-publish: false + - run: ./gradlew mainCheck --stacktrace + env: + # Reuse would hand one scenario the broker another scenario had already faulted. + TESTCONTAINERS_REUSE_ENABLE: "false" diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml new file mode 100644 index 0000000..ab3260d --- /dev/null +++ b/.gitea/workflows/pr.yml @@ -0,0 +1,29 @@ +# Pull-request stage. The job is the Gradle stage `ci`; which modules, lanes and gates that means is +# decided in build.gradle, not here (docs/work/gates.md). +name: pr + +on: + pull_request: + +permissions: + contents: read + +jobs: + ci: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: https://github.com/actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: temurin + java-version: "21.0.11+10.0.LTS" + # Validates the checked-in wrapper jar and caches Gradle's downloads. + - uses: https://github.com/gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6 + with: + build-scan-publish: false + cache-read-only: true + - run: ./gradlew ci --stacktrace + # Every strict lane is in a stage some workflow here executes. It plans the stages with + # --dry-run, so it cannot be a dependency of `ci` and is the one second line. + - run: ./gradlew verifyStrictLaneStages --dry-run --stacktrace diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..afbc471 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,42 @@ +# Release stage, on a vMAJOR.MINOR.PATCH tag (docs/work/release.md). One Gradle invocation: +# `releaseCheck` (integration lanes, broker certification gate, version, SBOM, dependency gate) and then +# `release` (publish every module and the SBOM to Gitea Packages, signed, and read the version back +# anonymously). Publishing starts only after releaseCheck has passed, so a red check leaves nothing +# half-published (Gitea refuses a second upload of a version). +# +# Secrets (repository settings, created by the owner): PACKAGE_TOKEN, a personal access token with +# package read/write only (the job token cannot publish packages); SIGNING_KEY, an ASCII-armoured PGP +# secret key; SIGNING_PASSWORD, its passphrase. +name: release + +on: + push: + tags: ["v*"] + +permissions: + contents: read + +jobs: + release: + runs-on: ubuntu-latest + timeout-minutes: 90 + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: https://github.com/actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: temurin + java-version: "21.0.11+10.0.LTS" + - uses: https://github.com/gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6 + with: + build-scan-publish: false + cache-read-only: true + # The tag names the version: ca.java-conventions refuses any RELEASE_TAG that is not + # vMAJOR.MINOR.PATCH. releaseCheck is named although release depends on it, because + # verifyStrictLaneStages counts a stage only when a command names it. + - run: ./gradlew releaseCheck release --stacktrace + env: + RELEASE_TAG: ${{ github.ref_name }} + PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + TESTCONTAINERS_REUSE_ENABLE: "false" diff --git a/.gitea/workflows/signing-check.yml b/.gitea/workflows/signing-check.yml new file mode 100644 index 0000000..461c8ae --- /dev/null +++ b/.gitea/workflows/signing-check.yml @@ -0,0 +1,29 @@ +# Checks the release signing secrets without cutting a tag (docs/work/release.md 5절). Manual only: +# run it after the owner puts SIGNING_KEY or SIGNING_PASSWORD in, and before tagging. It prints shapes +# and verdicts, never the secrets (scripts/release/check-signing-key.sh). +name: signing-check + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + signing-check: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: https://github.com/actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: temurin + java-version: "21.0.11+10.0.LTS" + - uses: https://github.com/gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6 + with: + build-scan-publish: false + cache-read-only: true + - run: ./gradlew verifySigningKey --stacktrace + env: + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}