Skip to content

justinawrey/shipit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shipit 🛶

deno module release

Like semantic-release, but opinionated, fast, and built with Deno in mind.

How is this different?

Its not, really. It's a different implementation of the same idea. However, some tweaks have been made to optimize for Deno:

  • Releases start at 0.1.0. This is a common convention for Node projects, but seems to be even more common for Deno projects.

  • No support for publishing to npm. Since deno.land/x syncs your code when you publish a Github release, publishing is all you need.

  • Documentation changes cause a minor version bump. Documentation is a feature, especially since deno doc will scrape your code. This decision is less of a Deno convention, and mostly my opinion.

  • The release workflow is opinionated, and as such runs fast and has zero configuration. feat!: will cause a major version bump, feat: or docs: will cause a minor version bump, and fix: will cause a patch version bump. Thats it!

Usage

Install shipit locally:

deno install --allow-env --allow-run --allow-net https://deno.land/x/shipit/shipit.ts

And ship it!

shipit

In order to be able to authenticate with Github, you must set an environment variable called GITHUB_TOKEN to a personal access token with repo permissions.

If you'd prefer to run shipit on CI, you can:

on:
  push:
    branches:
      - main

  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: denoland/setup-deno@v1
        with:
          deno-version: vx.x.x

      # Use latest version of shipit.  You may prefer to pin a specific version.
      - run: deno run --allow-net --allow-env --allow-run https://deno.land/x/shipit/shipit.ts
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Be sure to provide GITHUB_TOKEN as an environment variable to the shipit script, as well as set fetch-depth: 0 in the checkout step.

Granting permissions

shipit requires environment, network, and subprocess creation permissions:

  • --allow-env: shipit reads GITHUB_TOKEN from your local environment in order to authenticate with Github

  • --allow-run: shipit needs to spawn subprocesses (git, bash) in order to gather information about your commits

  • --allow-net: shipit needs to make outbound networks requests to Github in order to create Github releases

Examples

shipit uses itself for releases. You can see the shape of the generated releases here.