### Docker Usage Examples (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Provides examples of how to run release-me using a Docker container. This is beneficial for ensuring a consistent build environment and simplifying deployment in CI/CD pipelines. It shows both basic and custom option usage. ```bash # Run via Docker container docker run --rm \ --volume $(pwd):/repository \ -e GITHUB_TOKEN="${GITHUB_TOKEN}" \ -e GIT_USERNAME="CI Bot" \ -e GIT_EMAIL="ci@example.com" \ dalisoft/release-me:latest # With custom options docker run --rm \ --volume $(pwd):/repository \ -e GITHUB_TOKEN="${GITHUB_TOKEN}" \ dalisoft/release-me:latest \ --plugins=git,github-release --dry-run ``` -------------------------------- ### Basic Bash Usage of release-me Source: https://context7.com/dalisoft/release-me/llms.txt Demonstrates how to clone and execute the release-me script with default and custom configurations. Includes examples for dry-runs, verbose logging, and workspace mode. ```bash # Clone the tool into your project git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me # Run with default settings (git plugin only) bash .release-me/release.sh # Run with multiple plugins and dry-run mode bash .release-me/release.sh --plugins=git,github-release --dry-run # Enable verbose logging bash .release-me/release.sh --verbose # Workspace/monorepo mode bash .release-me/release.sh --workspace --plugins=npm,git,github-release ``` -------------------------------- ### Install Release-Me npm package Source: https://github.com/dalisoft/release-me/blob/master/docs/INSTALLATION.md This snippet shows how to install the release-me project as a development dependency using various package managers. It provides commands for npm, yarn, and bun, allowing developers to integrate the tool into their projects for automated release management. ```bash npm install release-me-sh --save-dev # or yarn add release-me-sh --dev # or bun add release-me-sh --dev ``` -------------------------------- ### Run Release-Me using Docker Source: https://github.com/dalisoft/release-me/blob/master/docs/INSTALLATION.md This snippet demonstrates how to run the release-me project using a Docker container. It pulls the latest image and mounts the current directory as a volume, allowing the tool to operate on the host's file system. The `--rm` flag ensures the container is removed after execution. ```bash docker run --rm --volume $(pwd):/repository dalisoft/release-me:latest ``` -------------------------------- ### Error Handling Examples (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Illustrates common error scenarios and their corresponding outputs. This section helps users diagnose and resolve issues such as not being in a Git repository, finding no new commits, or missing required tokens or tools. ```bash # Not a git repository bash .release-me/release.sh # Output: [release-me] Current directory is not a Git repository! # No commits found bash .release-me/release.sh # Output: [release-me] Your project has no new commits # Output: [release-me] Your project is up-to-date # No version bump needed bash .release-me/release.sh # Output: [release-me] Your project has no incremental update # Output: [release-me] Your project is up-to-date # Missing GitHub CLI for github-release plugin export GITHUB_TOKEN="token" bash .release-me/release.sh --plugins=github-release # Output: GitHub CLI not found your machine # Missing required token bash .release-me/release.sh --plugins=npm # Output: npm Token is not found # Output: Please export npm Token so this plugin can be used ``` -------------------------------- ### Add Release-Me as Git Submodule Source: https://github.com/dalisoft/release-me/blob/master/docs/INSTALLATION.md This snippet shows how to integrate release-me as a Git submodule. While functional, this method is not recommended due to potential complexities in managing submodules. It adds the repository as a submodule, stages the changes, and commits the integration. ```bash git submodule add -b master --name release-me --depth=1 -f https://github.com/dalisoft/release-me.git .release-me git add -A .release-me git commit -m "chore: integration of release-me to my project" ``` -------------------------------- ### Clone Release-Me using Git Source: https://github.com/dalisoft/release-me/blob/master/docs/INSTALLATION.md This snippet demonstrates how to clone the release-me project locally using Git. It's the recommended method for its ease of use and safety. The `--depth 1` option fetches only the latest commit, reducing download size. It also adds the cloned directory to `.gitignore` and commits this change. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me printf "%s" '.release-me' >> .gitignore' git add -A .gitignore git commit -m "chore: integration of release-me to my project" ``` -------------------------------- ### Dry Run Mode Examples (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Shows how to use the --dry-run flag to preview the release process without making any actual changes to your repository or publishing. This is useful for testing configurations and ensuring the script behaves as expected. ```bash # Preview what would happen without making changes bash .release-me/release.sh --dry-run --verbose # Check release with all plugins in dry-run bash .release-me/release.sh --plugins=npm,git,github-release --dry-run # Output example: # [release-me] Last project tag [v0.1.0] found # [release-me] Found 5 commits since last release # [release-me] Analyzing commits... # [release-me] Skipped Git tag [v0.2.0] in DRY-RUN mode. # [release-me] Skipped GitHub release [v0.2.0] in DRY-RUN mode. ``` -------------------------------- ### Workspace/Monorepo Support with release-me Source: https://context7.com/dalisoft/release-me/llms.txt Explains how to configure and run release-me in a workspace or monorepo environment, particularly with pnpm. Includes examples for setting up package.json scripts and running releases for all workspace packages. ```json # In root package.json: { "scripts": { "release": "pnpm -r --workspace-concurrency=1 exec ../../.release-me/release.sh -w --use-version --plugins=npm,git,github-release --preset=workspace" } } ``` ```bash # Run release for all workspace packages export NPM_TOKEN="npm_xxxxxxxxxxxxxx" export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" export GIT_USERNAME="CI Bot" export GIT_EMAIL="ci@example.com" pnpm run release # Workspace with custom preset bash .release-me/release.sh --workspace --preset=workspace --plugins=npm,git ``` -------------------------------- ### Install release-me via npm Source: https://context7.com/dalisoft/release-me/llms.txt Shows how to install the release-me script as a development dependency in an npm project and configure its usage within the package.json scripts. ```bash npm install release-me-sh --save-dev ``` ```json { "scripts": { "release": "release-me --plugins=npm,git,github-release" } } ``` -------------------------------- ### Get GPG Key ID (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/features/GPG_SIGN.md Retrieves the GPG key ID from the local system. This is a prerequisite for exporting the GPG key. Ensure you have GPG installed and configured. ```bash gpg --list-secret-keys ``` -------------------------------- ### Get SSH Public Key (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/features/SSH_SIGN.md Retrieves your SSH public key from the default location. This key is used to verify your identity when signing Git tags. Ensure you have already generated an SSH key pair following the provided guides. ```bash cat ~/.ssh/path_to_your_pubkey.pub ``` -------------------------------- ### Generate CHANGELOG with Bash Script Source: https://github.com/dalisoft/release-me/blob/master/docs/plugins/CHANGELOGS.md This snippet demonstrates how to clone the release-me repository and execute its bash script to generate a CHANGELOG. It requires git to be installed and specifies plugins for git and changelog functionality. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,changelog ``` -------------------------------- ### Clone and Run Release Me Script Source: https://github.com/dalisoft/release-me/blob/master/docs/USAGE.md This bash command clones the Release Me repository and executes the main release script with specified plugins and a conventional commits preset. Ensure you have git installed and write access to the target directory. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,github-release --preset=conventional-commits ``` -------------------------------- ### Conventional Commits Preset for release-me Source: https://context7.com/dalisoft/release-me/llms.txt Describes the Conventional Commits preset used by release-me for determining version bumps based on commit messages. Provides examples of commit types and their impact on versioning. ```bash # Default preset - automatically loaded bash .release-me/release.sh # Explicit preset specification bash .release-me/release.sh --preset=conventional-commits # Example commits and their version impact: # feat: add new feature → Minor version bump (0.1.0 → 0.2.0) # fix: resolve bug → Patch version bump (0.1.0 → 0.1.1) # feat!: breaking change → Major version bump (1.0.0 → 2.0.0) # chore: update dependencies → No version bump # docs: update README → No version bump ``` -------------------------------- ### Run release script using pnpm Source: https://github.com/dalisoft/release-me/blob/master/docs/features/WORKSPACE.md Demonstrates how to execute the 'release' script defined in package.json using pnpm. It also shows how to set environment variables from a .env file before running the script. ```bash pnpm run release ``` ```bash env $(cat .env) pnpm run release ``` -------------------------------- ### Custom Plugin Loading (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Explains how to load and order custom plugins for the release process. The order of plugins is critical as it defines the sequence of actions, such as pre-publish hooks, publishing, tagging, and release creation. ```bash # Multiple plugins in specific order bash .release-me/release.sh --plugins=npm-post,npm,git,github-release # Plugin order matters: # 1. npm-post: Pre-publish hooks # 2. npm: Publish to registry # 3. git: Create and push tags # 4. github-release: Create GitHub release # Single plugin bash .release-me/release.sh --plugins=git ``` -------------------------------- ### Version Management Options (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Demonstrates various options for managing project versions during the release process, including using package.json versions, forcing stable releases, and marking releases as pre-releases. These options allow fine-grained control over versioning strategies. ```bash # Use version from package.json instead of git tags (requires --workspace) bash .release-me/release.sh --workspace --use-version # Force stable release (0.x → 1.x) bash .release-me/release.sh --stable # Mark as pre-release bash .release-me/release.sh --pre-release # Combined options bash .release-me/release.sh --workspace --use-version --stable --plugins=npm,git,github-release ``` -------------------------------- ### npm Plugin Usage for release-me Source: https://context7.com/dalisoft/release-me/llms.txt Shows how to configure and use the npm plugin for publishing packages to the npm registry. Demonstrates publishing alone and as part of a combined release workflow. ```bash # Publish to npm registry export NPM_TOKEN="npm_xxxxxxxxxxxxxx" bash .release-me/release.sh --plugins=npm,git # Combined workflow: npm publish, git tag, GitHub release export NPM_TOKEN="npm_xxxxxxxxxxxxxx" export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" bash .release-me/release.sh --plugins=npm,git,github-release ``` -------------------------------- ### Clone and Run Git Plugin (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/plugins/GIT.md This snippet demonstrates how to clone the release-me repository and execute the Git plugin using a bash script. It requires cloning the repository and then running the release.sh script with the git plugin specified. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git ``` -------------------------------- ### GitHub Release Plugin Usage for release-me Source: https://context7.com/dalisoft/release-me/llms.txt Illustrates how to use the GitHub Release plugin to create releases and changelogs on GitHub. Includes options for standard releases, pre-releases, and promoting to stable versions. ```bash # Create GitHub releases with automatic changelog export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" bash .release-me/release.sh --plugins=git,github-release # Create pre-release export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" bash .release-me/release.sh --plugins=git,github-release --pre-release # Promote to stable version (from 0.x to 1.x) export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" bash .release-me/release.sh --plugins=git,github-release --stable ``` -------------------------------- ### Execute GitHub Release Script Source: https://github.com/dalisoft/release-me/blob/master/docs/plugins/GITHUB_RELEASE.md This snippet shows how to clone the release-me project and execute the release script using bash. It specifies the 'git' and 'github-release' plugins for the release process. Ensure you have the necessary GitHub token set as an environment variable. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,github-release ``` -------------------------------- ### Git Plugin Usage for release-me Source: https://context7.com/dalisoft/release-me/llms.txt Details the configuration options for the Git plugin in release-me. Covers basic tag creation, GPG signing, SSH signing, and disabling GPG signing. ```bash # Basic usage with Git tag creation only bash .release-me/release.sh --plugins=git # With GPG signing export GIT_USERNAME="John Doe" export GIT_EMAIL="john@example.com" export GPG_KEY_ID="YOUR_GPG_KEY_ID" export GPG_KEY="BASE64_ENCODED_GPG_KEY" export GPG_PASSPHRASE="your-passphrase" bash .release-me/release.sh --plugins=git # With SSH signing export GIT_USERNAME="John Doe" export GIT_EMAIL="john@example.com" export SSH_PRIVATE_KEY="BASE64_ENCODED_SSH_KEY" export SSH_PUBLIC_KEY="ssh-ed25519 AAAA..." export SSH_KEY_PASSPHRASE="your-passphrase" bash .release-me/release.sh --plugins=git # Disable GPG signing export GPG_NO_SIGN=true bash .release-me/release.sh --plugins=git ``` -------------------------------- ### Environment Variables Reference (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Lists and describes essential environment variables that can be configured to customize the behavior of release-me. These include settings for Git, GPG signing, SSH signing, publishing tokens, and CI mode. ```bash # Git configuration export GIT_USERNAME="Bot Name" export GIT_EMAIL="bot@example.com" # GPG signing export GPG_KEY_ID="ABCD1234" export GPG_KEY="$(base64 -w0 < private.key)" export GPG_PASSPHRASE="key-password" export GPG_NO_SIGN=true # Disable GPG signing # SSH signing export SSH_PRIVATE_KEY="$(base64 -w0 < id_ed25519)" export SSH_PUBLIC_KEY="$(cat id_ed25519.pub)" export SSH_KEY_PASSPHRASE="key-password" export SSH_NO_SIGN=true # Disable SSH signing # Publishing tokens export GITHUB_TOKEN="ghp_xxxxxxxxxxxxx" export NPM_TOKEN="npm_xxxxxxxxxxxxxx" # CI mode (enables verbose logging) export CI=true ``` -------------------------------- ### Configure GitHub Actions for release-me Source: https://context7.com/dalisoft/release-me/llms.txt Provides a complete GitHub Actions workflow configuration to automate releases. It checks out the code, sets up necessary environment variables, clones release-me, and runs the release script. ```yaml name: Release on: push: branches: [master] env: CI: true jobs: release: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - name: Release env: GIT_USERNAME: ${{ vars.GIT_USERNAME }} GIT_EMAIL: ${{ vars.GIT_EMAIL }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_KEY_ID: ${{ vars.GPG_KEY_ID }} GPG_KEY: ${{ secrets.GPG_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} shell: bash run: | git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,github-release ``` -------------------------------- ### Update Version and Publish to NPM via Bash Source: https://github.com/dalisoft/release-me/blob/master/docs/plugins/NPM.md This bash script demonstrates how to clone the release-me repository and execute the release process with the npm and git plugins enabled. It's used to update version fields and publish npm tags. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=npm,git ``` -------------------------------- ### Quiet and Verbose Modes (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Illustrates the usage of --quiet and --verbose flags to control the output level of the release process. --quiet minimizes output, while --verbose provides detailed information, useful for debugging. Verbose mode is automatically enabled in CI environments. ```bash # Minimal output bash .release-me/release.sh --quiet # Detailed output with debug information bash .release-me/release.sh --verbose # Verbose mode is automatically enabled on CI CI=true bash .release-me/release.sh ``` -------------------------------- ### Publish Docker Image using Bash Script Source: https://github.com/dalisoft/release-me/blob/master/docs/plugins/DOCKER.md This snippet demonstrates how to use the release-me bash script to publish a Docker image to Docker Hub. It requires cloning the repository and executing the script with the 'docker' plugin enabled. Ensure `DOCKER_HUB_USERNAME` and `DOCKER_HUB_PAT` environment variables are set. ```bash git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,docker ``` -------------------------------- ### Commit with Breaking Change (Bash) Source: https://context7.com/dalisoft/release-me/llms.txt Demonstrates how to create a commit message that includes a breaking change using conventional commit format. This is crucial for semantic versioning and informing users about significant API changes. ```bash git commit -m "feat: new api BREAKING CHANGE: API signature changed" ``` -------------------------------- ### Configure release script in package.json Source: https://github.com/dalisoft/release-me/blob/master/docs/features/WORKSPACE.md Adds a 'release' script to your package.json file to automate the release process for workspace packages. This script utilizes pnpm to execute a release script with specified plugins and presets. ```json { "release": "pnpm -r --workspace-concurrency=1 exec ../../.release-me/release.sh -w --use-version --plugins=npm,npm-post,git,github-release --preset=workspace" } ``` -------------------------------- ### GH Actions Release Workflow Configuration (.github/workflows/release.yml) Source: https://github.com/dalisoft/release-me/blob/master/docs/CONFIGURATION.md This YAML configuration defines the GitHub Actions workflow for releasing the project. It triggers on push and pull requests to the master branch. It requires specific environment variables and secrets to be set for checkout, token, Git credentials, and GPG keys. ```yaml name: Release on: push: branches: [master] pull_request: branches: [master] env: CI: true jobs: release: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # <-- This line is REQUIRED token: ${{ secrets.GITHUB_TOKEN }} # <-- This line is REQUIRED too - name: Release env: GIT_USERNAME: ${{ vars.GIT_USERNAME }} GIT_EMAIL: ${{ vars.GIT_EMAIL }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # <-- This line is REQUIRED too GPG_KEY_ID: ${{ vars.GPG_KEY_ID }} GPG_KEY: ${{ secrets.GPG_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} shell: bash run: | git clone https://github.com/dalisoft/release-me.git --depth 1 .release-me bash .release-me/release.sh --plugins=git,github-release ``` -------------------------------- ### Save Base64 Encoded SSH Private Key to File (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/features/SSH_SIGN.md Exports the Base64 encoded SSH private key to a file named 'ssh-base64'. This file can then be easily copied or used to set the SSH_PRIVATE_KEY environment variable. ```bash cat ~/.ssh/path_to_your_privatekey | base64 | base64 > ssh-base64 ``` -------------------------------- ### Export SSH Private Key to Base64 (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/features/SSH_SIGN.md Encodes your SSH private key into a Base64 format, which is necessary for storing it securely as an environment variable. This output can be directly used or further encoded into a file. ```bash cat ~/.ssh/path_to_your_privatekey | base64 ``` -------------------------------- ### Export Secret GPG Key (Bash) Source: https://github.com/dalisoft/release-me/blob/master/docs/features/GPG_SIGN.md Exports the secret GPG key associated with a specific key ID in base64 format. This exported key is then used to configure GPG signing in a release workflow. The output can be copied directly or saved to a file. ```bash gpg --export-secret-keys ABA8161A192052B2C8C2D68A82406676A919222E | base64 ``` ```bash gpg --export-secret-keys ABA8161A192052B2C8C2D68A82406676A919222E | base64 > gpg-base64 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.