Skip to content
box

GitHub Action

Cloudsmith CLI Setup

v1.0.0 Latest version

Cloudsmith CLI Setup

box

Cloudsmith CLI Setup

Set up Cloudsmith CLI in GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Cloudsmith CLI Setup

uses: cloudsmith-io/cloudsmith-cli-action@v1.0.0

Learn more about this action in cloudsmith-io/cloudsmith-cli-action

Choose a version

Cloudsmith CLI Install Action

This GitHub Action installs the Cloudsmith CLI and pre-authenticates it using OIDC or API Key. πŸš€

Inputs

  • cli-version: A specific version of the Cloudsmith CLI to install (optional). πŸ“¦
  • api-key: API Key for Cloudsmith (optional). πŸ”‘
  • oidc-namespace: Cloudsmith organisation/namespace for OIDC (optional). 🌐
  • oidc-service-slug: Cloudsmith service account slug for OIDC (optional). 🐌
  • pip-install: Install the Cloudsmith CLI via pip (optional). 🐍
  • executable-path: Path to the Cloudsmith CLI executable (optional, default: GITHUB_WORKSPACE/bin/). πŸ› οΈ

Example Usage with OIDC

Cloudsmith OIDC documentation πŸ“š

uses: cloudsmith-io/cloudsmith-cli-action@v1.0.0
with:
  oidc-namespace: 'your-oidc-namespace'
  oidc-service-slug: 'your-service-account-slug'

Example Usage with API Key

Personal API Key can be found here, for CI-CD deployments we recommend using Service Accounts. πŸ”’

uses: cloudsmith-io/cloudsmith-cli-action@v1.0.0
with:
  api-key: 'your-api-key'

Cloudsmith CLI Commands

Full CLI feature list can be found here πŸ“–

Publish a package

For all supported package formats and upload commands please visit our Supported Formats page. πŸ“¦

name: Publish Python Package

on:
  push:
    branches:
      - main
permission:
  id-token: write
jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Cloudsmith CLI
        uses: cloudsmith-io/cloudsmith-cli-action@v1.0.0
        with:
          oidc-namespace: 'your-oidc-namespace'
          oidc-service-slug: 'your-service-account-slug'

      - name: Push package to Cloudsmith
        run: |
          cloudsmith push python your-namespace/your-repository dist/*.tar.gz

Contribution

Please check our CONTRIBUTION doc for more information. 🀝

License

This project is licensed under the MIT License - see the LICENSE file for details. πŸ“„