Skip to content

Commit

Permalink
compo action
Browse files Browse the repository at this point in the history
  • Loading branch information
jackietung-redpanda committed Aug 30, 2024
1 parent a5fa7f3 commit 6c63923
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/actions/upload_managed_plugin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: upload-managed-plugin
description: Upload binaries as rpk managed plugin
inputs:
aws_access_key_id:
required: true
aws_secret_access_key:
required: true
aws_region:
required: true
aws_s3_bucket:
required: true
artifacts_file:
required: true
metadata_file:
required: true
plugin_name:
required: true
goos:
description: CSV list of target OS's
required: true
goarch:
description: CSV list of target arch's
required: true
repo_hostname:
required: true
dry_run:
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
run: pip install -r requirements.txt

- name: Upload archives
working-directory: resources/plugin_uploader
run: |
DRY_RUN_FLAG=${{ inputs.dry_run && '--dry-run' || '' }}
./plugin_uploader.py upload-archives \
--artifacts-file target/dist/artifacts.json \
--metadata-file target/dist/metadata.json \
--project-root-dir $(pwd) \
--region=${{ inputs.aws_region }} \
--bucket=${{ inputs.aws_s3_bucket }} \
--plugin=${{ inputs.plugin_name }} \
--goos=${{ inputs.goos }} \
--goarch=${{ inputs.goarch }} \
$DRY_RUN_FLAG
- name: Upload manifest
working-directory: resources/plugin_uploader
run: |
DRY_RUN_FLAG=${{ inputs.dry_run && '--dry-run' || '' }}
./plugin_uploader.py upload-manifest \
--region=${{ inputs.aws_region }} \
--bucket=${{ inputs.aws_s3_bucket }} \
--plugin=${{ inputs.plugin_name }} \
--repo-hostname=${{ inputs.repo_hostname }} \
$DRY_RUN_FLAG
44 changes: 44 additions & 0 deletions .github/workflows/release_rpk_connect_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release rpk connect plugin (managed)

on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run'
required: true
default: true
type: 'boolean'

jobs:
build_and_push_rpk_connect_plugin:
runs-on: ubuntu-latest
steps:
- name: Check Out 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: latest
args: build --timeout 120m

- name: Upload binaries as rpk managed plugin
uses: ./.github/actions/upload_managed_plugin
with:
aws_access_key_id: "TODO"
aws_secret_access_key: "TODO"
aws_region: "us-west-2"
aws_s3_bucket: "rpk-plugins-repo"
artifacts_file: target/dist/artifacts.json
metadata_file: target/dist/metadata.json
plugin_name: "connect"
goos: linux,darwin
goarch: amd64,arm64
repo_hostname: rpk-plugins.redpanda.com
dry_run: ${{ inputs.dry_run }}

0 comments on commit 6c63923

Please sign in to comment.