Skip to content

Commit

Permalink
Merge pull request #2920 from redpanda-data/PESDLC-1937-rm-rpk-plugin…
Browse files Browse the repository at this point in the history
…-publisher

gha: rm use of rpk_plugin_publisher
  • Loading branch information
andrewhsu authored Oct 8, 2024
2 parents 8310e87 + cab6f7e commit 9f07086
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 38 deletions.
20 changes: 2 additions & 18 deletions .github/actions/upload_managed_plugin/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
name: upload-managed-plugin
description: Upload binaries as rpk managed plugin
inputs:
aws_access_key_id:
description: For accessing S3 bucket
required: true
aws_secret_access_key:
description: For accessing S3 bucket
required: true
aws_region:
description: For accessing S3 bucket
required: true
Expand Down Expand Up @@ -37,26 +32,16 @@ inputs:
dry_run:
description: Dry run means skipping writes to S3 ("true" or "false")
required: true

runs:
using: "composite"
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ inputs.aws_access_key_id }}
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
aws-region: ${{ inputs.aws_region }}

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: install deps
working-directory: resources/plugin_uploader
shell: bash
run: pip install -r requirements.txt

- name: Upload archives
working-directory: resources/plugin_uploader
shell: bash
Expand All @@ -72,7 +57,6 @@ runs:
--goos=${{ inputs.goos }} \
--goarch=${{ inputs.goarch }} \
$DRY_RUN_FLAG
- name: Upload manifest
working-directory: resources/plugin_uploader
shell: bash
Expand All @@ -83,4 +67,4 @@ runs:
--bucket=${{ inputs.aws_s3_bucket }} \
--plugin=${{ inputs.plugin_name }} \
--repo-hostname=${{ inputs.repo_hostname }} \
$DRY_RUN_FLAG
$DRY_RUN_FLAG
22 changes: 2 additions & 20 deletions .github/workflows/upload_plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: Upload rpk connect plugin to S3

on:
push:
branches:
- main
branches: [main]
tags:
# All runs triggered by tag will really push to S3.
# Take care when adding more patterns here.
Expand All @@ -17,11 +16,9 @@ on:
- '.github/actions/upload_managed_plugin/**'
- '.goreleaser.yml'
workflow_dispatch: {}

env:
# Do dry run in most cases, UNLESS the triggering event was a "tag".
DRY_RUN: ${{ github.ref_type != 'tag' }}

jobs:
upload_rpk_connect_plugin:
# Let's make this fast by using a beefy runner.
Expand All @@ -36,41 +33,27 @@ jobs:
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

- uses: actions/checkout@v4

- 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 != 'false' }}
uses: goreleaser/goreleaser-action@v6
with:
version: 1.26.2
args: build --snapshot

- name: Build binaries
# Only one way to not dry run - see 'false'. All other cases, conservatively assume --dry-run
if: ${{ env.DRY_RUN == 'false' }}
uses: goreleaser/goreleaser-action@v6
with:
version: 1.26.2
args: build

- 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 }}
Expand All @@ -81,4 +64,3 @@ jobs:
goarch: amd64,arm64
repo_hostname: rpk-plugins.redpanda.com
dry_run: ${{ env.DRY_RUN != 'false' }}

0 comments on commit 9f07086

Please sign in to comment.