From 1d3ce44494468d413566c7f573aa41ea5a3eb307 Mon Sep 17 00:00:00 2001 From: Jackie Tung Date: Tue, 3 Sep 2024 12:52:49 -0700 Subject: [PATCH] improve dry run --- .github/workflows/upload_plugin.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/upload_plugin.yml b/.github/workflows/upload_plugin.yml index 36c521a562..27cea7c191 100644 --- a/.github/workflows/upload_plugin.yml +++ b/.github/workflows/upload_plugin.yml @@ -5,18 +5,16 @@ on: branches: - main tags: - # This filter affects how DRY_RUN is determined. RC's will get DRY_RUN=true + # All runs triggered by tag will really push to S3. + # Take care when adding more patterns here. - 'v[0-9]+.[0-9]+.[0-9]+' - 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' pull_request: { } workflow_dispatch: { } env: - # Only write to S3 for real, if: - # 1) it was a tag push - # 2) the tag looks like a real release tag (not an RC). - # This works in conjunction with workflow tag filters above - DRY_RUN: ${{ !( github.ref_type == 'tag' && !contains( github.ref, 'rc' ) ) }} + # Do dry run in most cases, UNLESS the triggering event was a "tag". + DRY_RUN: ${{ ! github.ref_type == 'tag' }} jobs: upload_rpk_connect_plugin: @@ -42,21 +40,25 @@ jobs: - name: Check out code repo uses: actions/checkout@v4 - - name: Add dummy tag for DRY_RUN (local only) - if: ${{ env.DRY_RUN }} - run: git tag -a "v999.999.999" -m "Dry run tag v999.999.999" - - name: Install Go uses: actions/setup-go@v5 with: go-version: 1.22.x check-latest: true + - name: Build binaries (dry run / snapshot mode) + if: ${{ env.DRY_RUN }} + uses: goreleaser/goreleaser-action@v6 + with: + version: 1.26.2 + args: build --snapshot + - name: Build binaries + if: ${{ ! env.DRY_RUN }} uses: goreleaser/goreleaser-action@v6 with: version: 1.26.2 - args: build --timeout 120m + args: build - name: Upload connect plugin to S3 uses: ./.github/actions/upload_managed_plugin