Skip to Content

Any CI

Just Shipped runs anywhere a Linux command or a container runs. There are two ways to get it into a job:

  • The executable, downloaded from a release and checked against the release's SHA256SUMS.
  • The Docker image, ghcr.io/cwaits6/justshipped, which also carries Chromium for screenshots.

GitHub Actions has its own action and GitLab CI/CD its own component.

Either way, the job needs the repository's full history and tags (no shallow clone), because the release range is resolved from them. The result is the release bundle in releases/: save that folder as the job's artifact.

Secrets are read by environment variable name only. For AI, give the job a provider key such as ANTHROPIC_API_KEY from your CI's secret store. Without one the run is rules-only.

Install the executable with curl

set -eu
version=1.2.3
asset=justshipped-linux-x64   # or justshipped-linux-arm64
base="https://github.com/cwaits6/justshipped/releases/download/$version"

curl -fsSL --proto '=https' --tlsv1.2 --retry 3 -o "$asset" "$base/$asset"
curl -fsSL --proto '=https' --tlsv1.2 --retry 3 -o SHA256SUMS "$base/SHA256SUMS"

# Stops here, before anything is made executable, when the download does not match.
grep " $asset\$" SHA256SUMS | sha256sum -c -

chmod +x "$asset"
./"$asset" generate

Pin version to a release rather than following the latest one, so a job's result does not change on its own. On macOS, use shasum -a 256 -c - in place of sha256sum -c -.

Run the Docker image

docker run --rm \
  --user "$(id -u):$(id -g)" \
  -v "$PWD:/work" \
  -e ANTHROPIC_API_KEY \
  ghcr.io/cwaits6/justshipped:1.2.3 generate
  • The image's entrypoint is justshipped and its working directory is /work, so mount the repository there and pass the arguments.
  • The image runs as a non-root user. --user "$(id -u):$(id -g)" makes it write releases/ as the user who owns the checkout.
  • -e ANTHROPIC_API_KEY passes the variable through by name; its value never appears in the command.
  • Pin the image to a version tag, or to a digest.

Woodpecker

.woodpecker/release-notes.yaml in the Pebble repository:

when:
  - event: tag

clone:
  git:
    image: woodpeckerci/plugin-git
    settings:
      partial: false
      depth: 0
      tags: true

steps:
  - name: justshipped
    image: ghcr.io/cwaits6/justshipped:1.2.3
    # Woodpecker runs the commands in a shell of its own, in place of the image's entrypoint.
    commands:
      - justshipped generate
    environment:
      ANTHROPIC_API_KEY:
        from_secret: anthropic_api_key

The bundle is written to releases/ in the workspace, where a later step can upload it to your artifact store.

Jenkins

A Jenkinsfile in the Pebble repository, using the Docker Pipeline plugin:

pipeline {
  agent any
  options { skipDefaultCheckout() }
  stages {
    stage('Checkout') {
      steps {
        // The full history and tags.
        checkout scmGit(
          branches: scm.branches,
          userRemoteConfigs: scm.userRemoteConfigs,
          extensions: [cloneOption(shallow: false, noTags: false)]
        )
      }
    }
    stage('Release notes') {
      agent {
        docker {
          image 'ghcr.io/cwaits6/justshipped:1.2.3'
          // Jenkins runs the steps in a shell of its own.
          args '--entrypoint='
          reuseNode true
        }
      }
      environment {
        ANTHROPIC_API_KEY = credentials('anthropic-api-key')
      }
      steps {
        sh 'justshipped generate'
      }
    }
  }
  post {
    success {
      archiveArtifacts artifacts: 'releases/**'
    }
  }
}

Jenkins starts the container as the agent's own user, so the bundle is written with the workspace's ownership.

Without Docker on the agent, run the curl install in an sh step instead.

Edit on GitHub

On this page