diff --git a/.github/workflows/actions/upload_managed_plugin/action.yml b/.github/workflows/actions/upload_managed_plugin/action.yml new file mode 100644 index 0000000000..64fb2440df --- /dev/null +++ b/.github/workflows/actions/upload_managed_plugin/action.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release_rpk_connect_plugin.yml b/.github/workflows/release_rpk_connect_plugin.yml new file mode 100644 index 0000000000..3d623d4226 --- /dev/null +++ b/.github/workflows/release_rpk_connect_plugin.yml @@ -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 }}