Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
155 changes: 155 additions & 0 deletions .github/workflows/dart_skills_lint_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: dart_skills_lint release
permissions: read-all

on:
push:
tags:
- 'dart_skills_lint-v*'

jobs:
build_binaries:
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: macos-arm64
- os: macos-13
target: macos-x64
- os: ubuntu-22.04
target: linux-x64
- os: ubuntu-22.04-arm
target: linux-arm64
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: tool/dart_skills_lint
shell: bash
steps:
- uses: actions/checkout@v6

- uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Resolve dependencies
run: dart pub get

- name: Compile native binary
run: |
set -euo pipefail
mkdir -p dist
dart compile exe bin/cli.dart -o "dist/dart_skills_lint-${TARGET}"
chmod +x "dist/dart_skills_lint-${TARGET}"
env:
TARGET: ${{ matrix.target }}

- name: Smoke-test binary
run: ./dist/dart_skills_lint-${{ matrix.target }} --help

- name: Package and hash
run: |
set -euo pipefail
cd dist
tar -czf "dart_skills_lint-${TARGET}.tar.gz" "dart_skills_lint-${TARGET}"
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "dart_skills_lint-${TARGET}.tar.gz" > "dart_skills_lint-${TARGET}.tar.gz.sha256"
else
shasum -a 256 "dart_skills_lint-${TARGET}.tar.gz" > "dart_skills_lint-${TARGET}.tar.gz.sha256"
fi
env:
TARGET: ${{ matrix.target }}

- name: Upload binary artifact
uses: actions/upload-artifact@v7
with:
name: dart_skills_lint-${{ matrix.target }}
path: |
tool/dart_skills_lint/dist/dart_skills_lint-${{ matrix.target }}.tar.gz
tool/dart_skills_lint/dist/dart_skills_lint-${{ matrix.target }}.tar.gz.sha256
if-no-files-found: error
retention-days: 7

release:
needs: build_binaries
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6

- name: Download all binary artifacts
uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true

- name: Build SHA256SUMS aggregate file
working-directory: dist
run: |
set -euo pipefail
: > SHA256SUMS
for f in *.tar.gz.sha256; do
cat "$f" >> SHA256SUMS
done
rm -f *.tar.gz.sha256
echo "--- SHA256SUMS ---"
cat SHA256SUMS

- name: Extract release metadata
id: meta
run: |
set -euo pipefail
# Tag pattern: dart_skills_lint-v<VERSION>. Strip prefix to get the version.
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#dart_skills_lint-v}"
if [ "$VERSION" = "$TAG" ]; then
echo "ERROR: tag '$TAG' does not match expected pattern 'dart_skills_lint-v<VERSION>'" >&2
exit 1
fi
# Verify pubspec matches.
PUBSPEC_VERSION=$(awk -F': *' '/^version:/ {print $2; exit}' tool/dart_skills_lint/pubspec.yaml)
if [ "$VERSION" != "$PUBSPEC_VERSION" ]; then
echo "ERROR: tag version '$VERSION' does not match pubspec.yaml version '$PUBSPEC_VERSION'" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# Pre-release detection for the GitHub Release flag.
case "$VERSION" in
*-dev.*|*-alpha.*|*-beta.*|*-rc.*|*-preview.*) echo "prerelease=true" >> "$GITHUB_OUTPUT" ;;
*) echo "prerelease=false" >> "$GITHUB_OUTPUT" ;;
esac

- name: Extract release notes from CHANGELOG
run: |
set -euo pipefail
awk -v ver="## ${VERSION}" '
$0 == ver { found = 1; next }
/^## / && found { exit }
found { print }
' tool/dart_skills_lint/CHANGELOG.md > release-notes.md
if [ ! -s release-notes.md ]; then
echo "ERROR: no CHANGELOG entry found for version '${VERSION}'" >&2
echo "Expected a heading line: ## ${VERSION}" >&2
exit 1
fi
echo "--- release notes ---"
cat release-notes.md
env:
VERSION: ${{ steps.meta.outputs.version }}

- name: Create GitHub Release

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a v0.5:

  • We can mark releases as immutable. Github will make the sha256 for us. Binaries cannot change.
  • It means we upload all binaries in the release step like this.
      - name: Create Immutable GitHub Release
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh release create ${{ github.ref_name }} ./all-assets/* \
            --title "Release ${{ github.ref_name }}" \
            --generate-notes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #165

uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
with:
tag_name: ${{ github.ref_name }}
name: dart_skills_lint v${{ steps.meta.outputs.version }}
body_path: release-notes.md
prerelease: ${{ steps.meta.outputs.prerelease }}
files: |
dist/*.tar.gz
dist/SHA256SUMS
tool/dart_skills_lint/scripts/install.sh
fail_on_unmatched_files: true
2 changes: 1 addition & 1 deletion .github/workflows/dart_skills_lint_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
# Action steps do not inherit defaults.run.working-directory, so this
# path is relative to the repository root.
- name: Enforce coverage threshold
uses: VeryGoodOpenSource/very_good_coverage@v3
uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3
with:
path: tool/dart_skills_lint/coverage/lcov.info
min_coverage: 73
Expand Down
15 changes: 15 additions & 0 deletions tool/dart_skills_lint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 0.4.0-dev.1

- **Pre-release.** Pin explicitly (`dart_skills_lint: 0.4.0-dev.1`) to
try the preview — caret ranges will not auto-pick this up.
- Native binaries for macOS arm64, macOS x64, Linux x64, and Linux
arm64 are now published to GitHub Releases. Install without the
Dart SDK via `curl -fsSL .../install.sh | bash`, or download the
tarball directly and verify its SHA256.
- macOS preview binaries are not yet code-signed; clear the
quarantine flag with
`xattr -d com.apple.quarantine $(which dart_skills_lint)` on
first launch.
- The `dart pub global activate dart_skills_lint` and
`dev_dependencies:` install paths are unchanged.

## 0.3.1

- `--fix` now writes fixes to disk; pair with `--dry-run`
Expand Down
83 changes: 76 additions & 7 deletions tool/dart_skills_lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,94 @@ For a full definition of the skill standard, see the [Agent Skills Specification

## Installation

Add `dart_skills_lint` to your Dart project or activate it globally.
`dart_skills_lint` ships as both a standalone native binary (no Dart
SDK required) and as a Dart package on pub.dev. Pick the path that
matches your environment.

### 1. As a project dependency
Add it to your `pubspec.yaml` (once published on pub.dev):
> **Homebrew note.** A `brew install dart-skills-lint` path is on the
> roadmap; it will land after `dart_skills_lint` migrates to its own
> dedicated repository. Until then, the install paths below cover all
> supported platforms.

### 1. Dart developers — pub.dev

If you already have the Dart SDK installed, the standard pub.dev paths
still work and are unchanged.

#### As a project dev_dependency

Add to your `pubspec.yaml`:
```yaml
dev_dependencies:
dart_skills_lint: ^0.3.0
```

To opt into the preview track, pin to the exact version:
```yaml
dev_dependencies:
dart_skills_lint: ^0.2.0
dart_skills_lint: 0.4.0-dev.1
```
Then run:

Then:
```bash
dart pub get
```

### 2. Globally activated
If you want to use it across multiple projects without adding it to each `pubspec.yaml`:
#### Globally activated

For multiple projects without per-project pubspec entries:
```bash
dart pub global activate dart_skills_lint
```

### 2. `install.sh` — Linux + macOS, no Dart required

The recommended path for CI runners and laptops without the Dart SDK
on PATH. Downloads the matching prebuilt binary from the latest GitHub
Release, verifies its SHA256, and installs to `/usr/local/bin` (with a
`sudo` fallback). Supports macOS arm64 + x64 and Linux x64 + arm64.

```bash
curl -fsSL https://github.com/flutter/skills/releases/latest/download/install.sh | bash
```

Optional env vars (set before the `bash` part):
- `INSTALL_DIR` — install destination (default `/usr/local/bin`).
- `VERSION` — pin a specific release like `0.4.0-dev.1` (default `latest`).
- `REPO` — alternate source repo (default `flutter/skills`).

#### macOS first-launch note

Preview binaries are not yet code-signed. The first time you run the
binary, macOS Gatekeeper will block it ("cannot be opened because the
developer cannot be verified"). Remove the quarantine flag once:

```bash
xattr -d com.apple.quarantine "$(which dart_skills_lint)"
```

This step goes away once notarized builds ship.

### 3. Direct download — Linux + macOS, no install script

For environments where piping a script to `bash` isn't acceptable.
Grab the tarball for your platform from
[the latest GitHub Release](https://github.com/flutter/skills/releases/latest)
and verify its SHA256 against the release's `SHA256SUMS` asset.

```bash
TARGET="linux-x64" # or: macos-arm64, macos-x64, linux-arm64
VERSION="0.4.0-dev.1"
BASE="https://github.com/flutter/skills/releases/download/dart_skills_lint-v${VERSION}"
curl -fsSLO "${BASE}/dart_skills_lint-${TARGET}.tar.gz"
curl -fsSLO "${BASE}/SHA256SUMS"
grep " dart_skills_lint-${TARGET}.tar.gz$" SHA256SUMS | sha256sum -c -
tar -xzf "dart_skills_lint-${TARGET}.tar.gz"
sudo install -m 0755 "dart_skills_lint-${TARGET}" /usr/local/bin/dart_skills_lint
```

On macOS, replace `sha256sum -c -` with `shasum -a 256 -c -`.

## Usage

`dart_skills_lint` runs as a command-line tool, configured by flags or by
Expand Down
2 changes: 1 addition & 1 deletion tool/dart_skills_lint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
A static analysis linter for Agent Skills (SKILL.md) written in Dart.
Validates frontmatter, naming, paths, and structure for use in CI and
pre-commit hooks.
version: 0.3.1
version: 0.4.0-dev.1
resolution: workspace
repository: https://github.com/flutter/skills
issue_tracker: https://github.com/flutter/skills/issues
Expand Down
Loading
Loading