-
Notifications
You must be signed in to change notification settings - Fork 44
docs: add release workflow skill for Claude #2308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Release Workflow | ||
|
|
||
| Creates a new release by triggering the GitHub Actions release-dispatch workflow. | ||
|
|
||
| ## Arguments | ||
|
|
||
| - `$ARGUMENTS`: Version type or specific version (e.g., `minor`, `patch`, `major`, or `0.12.0`) | ||
|
|
||
| ## Process | ||
|
|
||
| 1. **Determine the new version**: | ||
|
|
||
| ```bash | ||
| # Get current version from controller package | ||
| CURRENT_VERSION=$(jq -r '.version' packages/controller/package.json) | ||
| echo "Current version: $CURRENT_VERSION" | ||
| ``` | ||
|
|
||
| Based on the argument: | ||
| - `major`: Bump major version (e.g., 0.11.4 -> 1.0.0) | ||
| - `minor`: Bump minor version (e.g., 0.11.4 -> 0.12.0) | ||
| - `patch`: Bump patch version (e.g., 0.11.4 -> 0.11.5) | ||
| - Specific version (e.g., `0.12.0`): Use as-is | ||
|
|
||
| 2. **Trigger the release workflow**: | ||
|
|
||
| ```bash | ||
| # Trigger release-dispatch workflow | ||
| gh workflow run release-dispatch.yml \ | ||
| --field version=<NEW_VERSION> \ | ||
| --field tag=latest | ||
| ``` | ||
|
|
||
| For prerelease versions (containing `-alpha`, `-beta`, `-rc`): | ||
|
|
||
| ```bash | ||
| gh workflow run release-dispatch.yml \ | ||
| --field version=<NEW_VERSION> \ | ||
| --field tag=prerelease | ||
| ``` | ||
|
|
||
| 3. **Verify workflow started**: | ||
|
|
||
| ```bash | ||
| # List recent workflow runs | ||
| gh run list --workflow=release-dispatch.yml --limit=3 | ||
| ``` | ||
|
|
||
| 4. **Provide next steps**: | ||
|
|
||
| After triggering, inform the user: | ||
| - A PR titled "Prepare release: X.Y.Z" will be created from branch `prepare-release` | ||
| - A draft GitHub release will be created with tag `vX.Y.Z` | ||
| - Once the PR is merged, packages will be published to npm automatically | ||
| - The draft release will be finalized with changelog notes | ||
|
|
||
| ## Version calculation | ||
|
|
||
| Use semver rules to calculate the new version: | ||
| - Strip any prerelease suffix (e.g., `-alpha.1`) before bumping | ||
| - For `major`: Set to `<major+1>.0.0` | ||
| - For `minor`: Set to `<major>.<minor+1>.0` | ||
| - For `patch`: Set to `<major>.<minor>.<patch+1>` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,27 +20,50 @@ | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dorny/paths-filter@v3 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium test
Unpinned 3rd party Action 'test' step
Uses Step: changes Error loading related location Loading |
||
| id: changes | ||
| with: | ||
| filters: | | ||
| code: | ||
| - '**/*.ts' | ||
| - '**/*.tsx' | ||
| - '**/*.js' | ||
| - '**/*.jsx' | ||
| - '!**/package.json' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent JSON path filter across workflow filesThe Additional Locations (1)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dependency-only updates skip all CI checksThe Additional Locations (1) |
||
|
|
||
| - name: Skip for version-only changes | ||
| if: steps.changes.outputs.code != 'true' | ||
| run: echo "Only version changes detected, skipping tests" | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| if: steps.changes.outputs.code == 'true' | ||
| with: | ||
| node-version: 20.x | ||
| - uses: actions/cache@v4 | ||
| if: steps.changes.outputs.code == 'true' | ||
| with: | ||
| path: ~/.pnpm-store | ||
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm- | ||
| - uses: pnpm/action-setup@v4 | ||
| if: steps.changes.outputs.code == 'true' | ||
| with: | ||
| run_install: | | ||
| - args: [--frozen-lockfile] | ||
| - name: Clean iframe dist directory | ||
| if: steps.changes.outputs.code == 'true' | ||
| run: rm -rf packages/controller/dist | ||
| - run: pnpm build | ||
| if: steps.changes.outputs.code == 'true' | ||
| - name: Run tests with coverage | ||
| if: steps.changes.outputs.code == 'true' | ||
| run: pnpm test:ci --coverage | ||
| env: | ||
| NODE_OPTIONS: --max-old-space-size=16384 | ||
| - uses: codecov/codecov-action@v3 | ||
| if: steps.changes.outputs.code == 'true' | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: coverage/lcov.info | ||
|
|
@@ -72,10 +95,20 @@ | |
| ui: | ||
| - '.github/workflows/test.yml' | ||
| - 'packages/keychain/**' | ||
| - '**/package.json' | ||
| - '**/pnpm-lock.yaml' | ||
|
|
||
| - if: steps.changes.outputs.ui == 'true' | ||
| code: | ||
| - '**/*.ts' | ||
| - '**/*.tsx' | ||
| - '**/*.js' | ||
| - '**/*.jsx' | ||
| - '**/*.css' | ||
| - '!**/package.json' | ||
|
|
||
| - name: Skip for version-only changes | ||
| if: steps.changes.outputs.code != 'true' | ||
| run: echo "Only version changes detected, skipping storybook tests" | ||
|
|
||
| - if: steps.changes.outputs.code == 'true' && steps.changes.outputs.ui == 'true' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cache step condition stricter than build stepsThe cache step in the storybook job requires both Additional Locations (1) |
||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
|
|
@@ -89,12 +122,16 @@ | |
| ${{ runner.os }}-storybook- | ||
|
|
||
| - run: pnpm i --frozen-lockfile | ||
| if: steps.changes.outputs.code == 'true' | ||
| - run: pnpm build | ||
| if: steps.changes.outputs.code == 'true' | ||
| - run: pnpm test:storybook:update | ||
| if: steps.changes.outputs.code == 'true' | ||
| id: test-storybook | ||
| continue-on-error: true | ||
|
|
||
| - name: Update and commit snapshots | ||
| if: steps.changes.outputs.code == 'true' | ||
| id: update-snapshots | ||
| run: | | ||
| # Check if there are any changes to commit | ||
|
|
@@ -260,7 +297,7 @@ | |
|
|
||
| # Modify the final check step to handle different failure types | ||
| - name: Check for failures | ||
| if: always() # Run this step even if previous steps failed | ||
| if: always() && steps.changes.outputs.code == 'true' | ||
| run: | | ||
| echo "Test Storybook Outcome: ${{ steps.test-storybook.outcome }}" | ||
| echo "Snapshot Failed (changes detected in PR diff): ${{ env.snapshot_failed }}" | ||
|
|
||
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium