From 2d2ae71ff1931d1758532260766f7e16dc9689a8 Mon Sep 17 00:00:00 2001 From: Smyslov Maxim Date: Wed, 18 Feb 2026 17:39:11 +0300 Subject: [PATCH 1/2] [feat] add PR build workflow to release.yaml Signed-off-by: Smyslov Maxim --- .github/workflows/release.yaml | 68 +++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4e673ee1..57e1e37d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -201,4 +201,70 @@ jobs: - name: Run lint run: | - task lint:check \ No newline at end of file + task lint:check + + + pr-build: + if: github.event_name == 'pull_request' + runs-on: [self-hosted, regular] + container: + image: ubuntu:22.04 + name: Build for PR + steps: + - name: Install dependency for linux-amd64 dist + env: + DEBIAN_FRONTEND: noninteractive + run: apt-get update && apt-get install -y apt-utils libbtrfs-dev file git gcc dnsutils + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # To use `git describe --tags` + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + cache: false # Cache download takes longer that a build from scratch + + - name: Setup Task + uses: arduino/setup-task@v2 + + - name: Start ssh-agent + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: | + ${{secrets.SOURCE_REPO_SSH_KEY}} + + - name: Add ssh_known_hosts + run: | + echo "::add-mask::$PRIVATE_REPO" + IPS=$(nslookup "$PRIVATE_REPO" | awk '/^Address: / { print $2 }') + for IP in $IPS; do + echo "::add-mask::$IP" + done + mkdir -p /root/.ssh + touch /root/.ssh/known_hosts + HOST_KEYS=$(ssh-keyscan -H "$PRIVATE_REPO" 2>/dev/null) + echo "$HOST_KEYS" | while IFS= read -r KEY_LINE; do + CONSTANT_PART=$(echo "$KEY_LINE" | awk '{print $2, $3}') + if ! grep -q "$CONSTANT_PART" /root/.ssh/known_hosts; then + echo "$KEY_LINE" >> /root/.ssh/known_hosts + fi + done + + - name: Setup git + run: | + git config --global url."ssh://git@${PRIVATE_REPO}/".insteadOf "https://flant.internal/" + git config --global --add safe.directory '*' + + - name: Build and package + run: task build-and-package + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: deckhouse-cli-pr-build-${{ github.run_id }} + path: dist/**/*.tar.gz + retention-days: 1 + compression-level: 9 From ce8ebe81cac3c8787e7a05bad57cbbaddbcde91b Mon Sep 17 00:00:00 2001 From: Smyslov Maxim Date: Wed, 18 Feb 2026 18:14:22 +0300 Subject: [PATCH 2/2] archive Signed-off-by: Smyslov Maxim --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 57e1e37d..ae870b06 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -264,7 +264,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: deckhouse-cli-pr-build-${{ github.run_id }} + name: deckhouse-cli-pr-build-${{ github.run_id }}.tar.gz path: dist/**/*.tar.gz retention-days: 1 compression-level: 9