Skip to content

Github Action that uses the cloudsmith cli to interact with the Cloudsmith API (pushes, etc)

License

Notifications You must be signed in to change notification settings

AutoModality/action-cloudsmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudsmith Github Action

Interact with Cloudsmith repositories using the cloudmsith cli to push packages, etc.

Cloudsmith CLI

This action uses the Cloudsmith CLI and intends to be as similar to its structure and terminology as possible.

Implemented

Not Implemented

  • Everything else

Cloudsmith API Key

The API key is required for the cloudsmith-cli to work.

Obtain the API Key from Cloudsmith user settings. You should use a less priveleged and generic account for Continuous Integration.

Add a secret named CLOUDSMITH_API_KEY and a value of the API Key obtained from cloudsmith. Secrets are maintained in the settings of each repository.

Pass your secret to the Action as seen in the Example usage.

Examples

Raw File Push

Package Workflow Status

Latest Version @ Cloudsmith

See push-raw.yml

name: Push Raw
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Raw File Push Test
    steps:
    - uses: actions/checkout@v1
    - name: Push
      id: push
      uses: AutoModality/action-cloudsmith@0.2.0
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'raw'
        owner: 'automodality'
        repo: 'trial'
        file: 'test/fixture/raw-file.txt' 
        name: 'Raw Test'
        summary: 'Github Action test of raw pushes'
        description: 'See https://github.com/AutoModality/action-cloudsmith/actions'
        version: ${{ github.sha}}

Debian Package Push

Package Workflow Status

Latest Version @ Cloudsmith

See push-debian.yml

name: Push Debian
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Debian Push Demo
    steps:
    - uses: actions/checkout@v1
    - name: Push
      id: push
      uses: AutoModality/action-cloudsmith@0.2.0
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'deb'
        owner: 'automodality'
        repo: 'trial'
        distro: 'ubuntu'
        release: 'xenial'
        republish: 'true'
        file: 'test/fixture/aruco_3.1.0-1_amd64.deb' #real file, but will fail due to repeat versions

Docker Image Push

Package Workflow Status

No Cloudsmith Repository Badge?

Note: In most cases, it is better to use the native docker cli to push images to the Cloudsmith Repository. Search the Marketplace for many supporting implementations.

See push-docker.yml

name: Push Docker
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Docker Push Demo
    steps:
    - uses: actions/checkout@v1
    - name: Push
      id: push
      uses: AutoModality/action-cloudsmith@0.3.0
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'docker'
        owner: 'automodality'
        repo: 'trial'
        republish: 'true' # needed since version is not changing
        file: 'test/fixture/alpine-docker-test.tar.gz' #alpine image saved to file

About

Github Action that uses the cloudsmith cli to interact with the Cloudsmith API (pushes, etc)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published