Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b2083fa
build(deps): bump jws from 4.0.0 to 4.0.1 (#650)
dependabot[bot] Dec 5, 2025
2f3d5e7
feat(npm): Add workspaces support (#645)
BYK Dec 5, 2025
2a59d5b
release: 2.13.0
getsentry-bot Dec 9, 2025
326e028
Merge branch 'release/2.13.0'
Dec 9, 2025
a280278
meta: Bump new development version
Dec 9, 2025
ab764c4
docs: Add AGENTS.md (#652)
BYK Dec 9, 2025
92f8bc2
fix: Fix startup issue with yargs (#651)
BYK Dec 9, 2025
02997ff
ci: Fix release input desc and concurrency (#653)
BYK Dec 9, 2025
164a26d
release: 2.13.1
getsentry-bot Dec 9, 2025
58a213f
Merge branch 'release/2.13.1'
Dec 9, 2025
dfc9c77
meta: Bump new development version
Dec 9, 2025
6b4f2eb
ci: Update action-prepare-release to v1.6.5 (#654)
BYK Dec 9, 2025
e20960f
feat: Add `skip-changelog` label by default (#655)
BYK Dec 10, 2025
061f9fa
feat: Add automatic version bumping based on conventional commits (#656)
BYK Dec 11, 2025
f60aba9
feat(docker): Add support for multiple registries (#657)
BYK Dec 12, 2025
48dcf44
fix(changelog): Unscoped entries should be grouped under "other" (#659)
BYK Dec 16, 2025
7647cba
fix(docker): Support regional Artifact Registry endpoints in isGoogl…
BYK Dec 22, 2025
8c1d5d4
release: 2.14.0
getsentry-bot Dec 23, 2025
1f233b3
Merge branch 'release/2.14.0'
Dec 23, 2025
9bb78b7
meta: Bump new development version
Dec 23, 2025
30a10d6
fix(changelog): Add ref and perf to internal changes prefixes (#662)
BYK Dec 23, 2025
cfde160
ci(deps): Upgrade action-prepare-release to latest (#663)
BYK Dec 23, 2025
72f2d04
fix(changelog): Fix whitespace related issues (#664)
BYK Dec 23, 2025
d44e074
ci(release): Add support for auto versioning (#665)
BYK Dec 23, 2025
114a419
release: 2.14.1
getsentry-bot Dec 23, 2025
54cfe0e
Merge branch 'release/2.14.1'
Dec 23, 2025
3ee48f1
meta: Bump new development version
Dec 23, 2025
46531b2
feat(github): Emit resolved version to GITHUB_OUTPUTS on prepare (#666)
BYK Dec 23, 2025
2f8efe0
feat(github): Integrate action-prepare-release into Craft repo (#667)
BYK Dec 24, 2025
204f7e3
release: 2.15.0
BYK Dec 24, 2025
79ae68a
Merge branch 'release/2.15.0'
Dec 24, 2025
ead185f
meta: Bump new development version
Dec 24, 2025
4bc2aca
docs: New documentation site! (#668)
BYK Dec 26, 2025
29cfe75
feat(changelog): Add changelog preview action and CLI command (#669)
BYK Dec 26, 2025
c0d4684
Merge branch 'master' into cursor/merge-conflict-resolution-802c
cursoragent Dec 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
minVersion: '0.30.0'
changelogPolicy: auto
minVersion: '2.14.0'
changelog:
policy: auto
preReleaseCommand: >-
node -p "
const {execSync} = require('child_process');
Expand Down Expand Up @@ -42,4 +43,6 @@ targets:
target: getsentry/craft
targetFormat: '{{{target}}}:latest'
- name: github
floatingTags:
- 'v{major}'
- name: gh-pages
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
es2017: true,
node: true,
},
ignorePatterns: ['docs/**'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- master
- release/**
pull_request:
workflow_call:

concurrency:
group: ${{ github.ref_name || github.sha }}
cancel-in-progress: true

jobs:
test:
Expand Down Expand Up @@ -52,10 +57,19 @@ jobs:
run: yarn install --frozen-lockfile
- name: Build
run: yarn build --define:process.env.CRAFT_BUILD_SHA='"'${{ github.sha }}'"'
- name: Smoke Test
run: ./dist/craft --help
- name: NPM Pack
run: npm pack
- name: Docs
run: cd docs && zip -r ../gh-pages _site/
- name: Build Docs
working-directory: docs
run: |
yarn install --frozen-lockfile
yarn build
- name: Package Docs
run: |
cp .nojekyll docs/dist/
cd docs/dist && zip -r ../../gh-pages.zip .
- name: Archive Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Changelog Preview

on:
# Allow this workflow to be called from other repositories
workflow_call:
inputs:
craft-version:
description: 'Version of Craft to use (tag or "latest")'
required: false
type: string
default: 'latest'

# Also run on PRs in this repository (for dogfooding)
# Includes 'edited' and 'labeled' to update when PR title/description/labels change
pull_request:
types: [opened, synchronize, reopened, edited, labeled]

permissions:
pull-requests: write

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Install Craft using the shared install action
# TODO: Change to @v2 or @master after this PR is merged
- name: Install Craft
uses: getsentry/craft/install@pull/669/head
with:
craft-version: ${{ inputs.craft-version || 'latest' }}

- name: Generate Changelog Preview
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CRAFT_LOG_LEVEL: Warn
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"

# Generate changelog with current PR injected and highlighted (JSON format)
echo "Running craft changelog --pr $PR_NUMBER --format json..."
RESULT=$(craft changelog --pr "$PR_NUMBER" --format json 2>/dev/null || echo '{"changelog":"","bumpType":null}')

# Extract fields from JSON
CHANGELOG=$(echo "$RESULT" | jq -r '.changelog // ""')
BUMP_TYPE=$(echo "$RESULT" | jq -r '.bumpType // "none"')

if [[ -z "$CHANGELOG" ]]; then
CHANGELOG="_No changelog entries will be generated from this PR._"
fi

# Format bump type for display
case "$BUMP_TYPE" in
major) BUMP_BADGE="🔴 **Major** (breaking changes)" ;;
minor) BUMP_BADGE="🟡 **Minor** (new features)" ;;
patch) BUMP_BADGE="🟢 **Patch** (bug fixes)" ;;
*) BUMP_BADGE="⚪ **None** (no version bump detected)" ;;
esac

# Build comment body using a temp file (safer than heredoc)
COMMENT_FILE=$(mktemp)
cat > "$COMMENT_FILE" << CRAFT_CHANGELOG_COMMENT_END
<!-- craft-changelog-preview -->
## Suggested Version Bump

${BUMP_BADGE}

## 📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).

---

${CHANGELOG}

---

<sub>🤖 This preview updates automatically when you update the PR.</sub>
CRAFT_CHANGELOG_COMMENT_END

# Find existing comment with our marker
COMMENT_ID=$(gh api \
"repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \
--jq '.[] | select(.body | contains("<!-- craft-changelog-preview -->")) | .id' \
| head -1)

if [[ -n "$COMMENT_ID" ]]; then
echo "Updating existing comment $COMMENT_ID..."
gh api -X PATCH \
"repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID" \
-F body=@"$COMMENT_FILE"
else
echo "Creating new comment..."
gh api -X POST \
"repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \
-F body=@"$COMMENT_FILE"
fi

rm -f "$COMMENT_FILE"
69 changes: 69 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docs Preview

on:
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs-preview.yml'

permissions:
contents: write
pull-requests: write

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'

- name: Build Docs for Preview
working-directory: docs
env:
# Override base path for PR preview
DOCS_BASE_PATH: /craft/pr-preview/pr-${{ github.event.pull_request.number }}
run: |
yarn install --frozen-lockfile
yarn build

- name: Ensure .nojekyll at gh-pages root
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Try to fetch the gh-pages branch
if git fetch origin gh-pages:gh-pages 2>/dev/null; then
# Branch exists remotely, check if .nojekyll is present
if git show gh-pages:.nojekyll &>/dev/null; then
echo ".nojekyll already exists at gh-pages root"
else
echo "Adding .nojekyll to existing gh-pages branch"
git checkout gh-pages
touch .nojekyll
git add .nojekyll
git commit -m "Add .nojekyll to disable Jekyll processing"
git push origin gh-pages
git checkout -
fi
else
# Branch doesn't exist, create it as an orphan branch
echo "Creating gh-pages branch with .nojekyll"
git checkout --orphan gh-pages
git rm -rf .
touch .nojekyll
git add .nojekyll
git commit -m "Initialize gh-pages with .nojekyll"
git push origin gh-pages
git checkout -
fi

- name: Deploy Preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: docs/dist/
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
name: Release
concurrency: ${{ github.workflow }}-${{ github.ref }}
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: false
required: true
default: "auto"
force:
description: Force a release even when there are release-blockers (optional)
required: false

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
permissions:
contents: read

release:
needs: build
runs-on: ubuntu-latest
name: 'Release a new version'
permissions:
Expand All @@ -27,7 +37,7 @@ jobs:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/action-prepare-release@3cea80dc3938c0baf5ec4ce752ecb311f8780cdc # v1
uses: ./
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ coverage/
dist/
node_modules/

# Docs build artifacts
docs/dist/
docs/node_modules/
docs/.astro/

yarn-error.log
npm-debug.log

Expand Down
Empty file added .nojekyll
Empty file.
68 changes: 68 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# AGENTS.md

This file provides guidance for AI coding assistants working with the Craft codebase.

## Package Management

- **Always use `yarn`** (v1) for package management. Never use `npm` or `pnpm`.
- Node.js version is managed by [Volta](https://volta.sh/) (currently v22.12.0).
- Install dependencies with `yarn install --frozen-lockfile`.

## Development Commands

| Command | Description |
|---------|-------------|
| `yarn build` | Build the project (outputs to `dist/craft`) |
| `yarn test` | Run tests |
| `yarn lint` | Run ESLint |
| `yarn fix` | Auto-fix lint issues |

To manually test changes:

```bash
yarn build && ./dist/craft
```

## Code Style

- **TypeScript** is used throughout the codebase.
- **Prettier** with single quotes and no arrow parens (configured in `.prettierrc.yml`).
- **ESLint** extends `@typescript-eslint/recommended`.
- Unused variables prefixed with `_` are allowed (e.g., `_unusedParam`).

## Project Structure

```
src/
├── __mocks__/ # Test mocks
├── __tests__/ # Test files (*.test.ts)
├── artifact_providers/ # Artifact provider implementations
├── commands/ # CLI command implementations
├── schemas/ # JSON schema and TypeScript types for config
├── status_providers/ # Status provider implementations
├── targets/ # Release target implementations
├── types/ # Shared TypeScript types
├── utils/ # Utility functions
├── config.ts # Configuration loading
├── index.ts # CLI entry point
└── logger.ts # Logging utilities
dist/
└── craft # Single bundled executable (esbuild output)
```

## Testing

- Tests use **Jest** with `ts-jest`.
- Test files are located in `src/__tests__/` and follow the `*.test.ts` naming pattern.
- Run tests with `yarn test`.

## CI/CD

- Main branch is `master`.
- CI runs tests on Node.js 20 and 22.
- Craft releases itself using its own tooling (dogfooding).

## Configuration

- Project configuration lives in `.craft.yml` at the repository root.
- The configuration schema is defined in `src/schemas/`.
Loading
Loading