Skip to content

Commit

Permalink
improve dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
jackietung-redpanda committed Sep 3, 2024
1 parent c81123b commit 1d3ce44
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/upload_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 1d3ce44

Please sign in to comment.