Skip to content

[CI] Distribute connect as a rpk managed plugin #1

[CI] Distribute connect as a rpk managed plugin

[CI] Distribute connect as a rpk managed plugin #1

Workflow file for this run

name: Upload rpk connect plugin to S3
on:
push:
branches:
- main
tags:
# This filter affects how DRY_RUN is determined. RC's will get DRY_RUN=true
- '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' ) ) }}
jobs:
upload_rpk_connect_plugin:
# Let's make this fast
runs-on: ubuntu-latest-32
permissions:
contents: read
id-token: write
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.RP_AWS_CRED_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
- name: Get secrets from AWS Secrets Manager (for read/writing S3-backed plugins repo)
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/rpk_plugin_publisher
parse-json-secrets: true
- name: Check out code repo
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
check-latest: true
- name: Build binaries
uses: goreleaser/goreleaser-action@v6
with:
version: 1.26.2
args: build --timeout 120m
- name: Upload connect plugin to S3
uses: ./.github/actions/upload_managed_plugin
with:
aws_access_key_id: ${{ env.RPK_PLUGIN_PUBLISHER_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ env.RPK_PLUGIN_PUBLISHER_AWS_SECRET_ACCESS_KEY }}
aws_region: "us-west-2"
aws_s3_bucket: "rpk-plugins-repo"
project_root_dir: ${{ github.workspace }}
artifacts_file: ${{ github.workspace }}/target/dist/artifacts.json
metadata_file: ${{ github.workspace }}/target/dist/metadata.json
plugin_name: "connect"
goos: linux,darwin
goarch: amd64,arm64
repo_hostname: rpk-plugins.redpanda.com
dry_run: ${{ env.DRY_RUN }}