From c60c75c833ef22529a0d40f924d0b54b65726020 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 13 Dec 2023 15:46:22 +0300 Subject: [PATCH] ci: do not rebuild but use artifacts from the `build` job (#11180) --- .github/workflows/ci.yaml | 53 ++++++++++----------------------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1633315d27..4c4e9e1dd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -835,22 +835,14 @@ jobs: TOKEN_SAO_PAULO: ${{ secrets.FLY_SAO_PAULO_CODER_PROXY_SESSION_TOKEN }} deploy-legacy-proxies: - name: "deploy-legacy-proxies" - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-16vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ubuntu-latest timeout-minutes: 30 - needs: changes - if: | - github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork - && needs.changes.outputs.docs-only == 'false' + needs: build + if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork permissions: contents: read id-token: write steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: @@ -860,30 +852,11 @@ jobs: - name: Set up Google Cloud SDK uses: google-github-actions/setup-gcloud@v2 - - name: Setup Node - uses: ./.github/actions/setup-node - - - name: Setup Go - uses: ./.github/actions/setup-go - - - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports@latest - - name: Install nfpm - run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0 - - - name: Install zstd - run: sudo apt-get install -y zstd - - - name: Build Release - run: | - set -euo pipefail - go mod download - - version="$(./scripts/version.sh)" - make gen/mark-fresh - make -j \ - build/coder_"$version"_windows_amd64.zip \ - build/coder_"$version"_linux_amd64.{tar.gz,deb} + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: coder + path: ./build - name: Install Release run: | @@ -896,11 +869,11 @@ jobs: "southamerica-east1-b coder-brazil coder-workspace-proxy" ) - deb_pkg="./build/coder_$(./scripts/version.sh)_linux_amd64.deb" - if [ ! -f "$deb_pkg" ]; then - echo "deb package not found: $deb_pkg" - ls -l ./build - exit 1 + deb_pkg=$(find ./build -name "coder_*_linux_amd64.deb" -print -quit) + if [ -z "$deb_pkg" ]; then + echo "deb package $deb_pkg not found" + ls -l ./build + exit 1 fi gcloud config set project coder-dogfood