A script specifically designed for the decaf deployment automation tool. This script automates the deployment of jsr packages by updating the package version and publishing to the jsr registry.
Important: This is exclusively for use with decaf. You must use decaf to utilize this script - it's not a standalone tool for general use.
This is a decaf deploy step script that handles jsr package deployment. When decaf has determined a new version should be released, this script will:
- Publish a new version of the package to match the release version determined by decaf
- Check if the version is already deployed to jsr (to avoid the script throwing an error because of jsr not allowing you to publish the same version multiple times)
- Publish the package to jsr
No installation required! We just need to tell decaf how to run this script (via npx, deno, or a compiled binary).
Here are some simple examples for how to run this script with decaf on GitHub Actions or from the command line.
GitHub Actions Example
- uses: levibostian/decaf
with:
deploy: npx @levibostian/decaf-script-jsr
# Other decaf arguments...Command Line Example
decaf \
--deploy "npx @levibostian/decaf-script-jsr"Note: The above examples use
npxand are arguably the easiest way to run the script. See below for alternative installation methods.
The above examples use npx and are arguably the easiest way to run the script. But, you have a few other options too:
- Run with Deno (requires Deno installed)
deploy: deno run --allow-all --quiet jsr:@levibostian/decaf-script-jsr- Run as a compiled binary
Great option that doesn't depend on node or deno. This just installs a binary from GitHub and runs it for your operating system.
deploy: curl -fsSL https://github.com/levibostian/decaf-script-jsr/blob/HEAD/install?raw=true | bash -s "0.1.0" && ./decaf-script-jsr
# Or, always run the latest version (less stable, but always up-to-date)
deploy: curl -fsSL https://github.com/levibostian/decaf-script-jsr/blob/HEAD/install?raw=true | bash && ./decaf-script-jsrThis script requires minimal configuration and works automatically with decaf's deploy step.
--package-path- (Optional) Path to the directory containing the jsr.json, deno.jsonc, or deno.json file. Defaults to the current directory.
Example:
npx @levibostian/decaf-script-jsr --package-path ./packages/my-packageAny arguments you pass to this script (except --package-path) will be forwarded directly to the jsr publish command. This allows you to customize jsr's behavior as needed.
Example:
# Use any jsr publish flag
npx @levibostian/decaf-script-jsr --allow-dirty
# Combine with package path
npx @levibostian/decaf-script-jsr --package-path ./packages/my-package --allow-slow-typesSee the jsr publish documentation for all available options.
This script simply runs jsr publish, so you'll need to ensure your jsr authentication is set up correctly in the environment where decaf is running.
See the jsr documentation and choose the method that best fits your CI/CD environment.