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
21 changes: 0 additions & 21 deletions .cargo/config.toml

This file was deleted.

10 changes: 4 additions & 6 deletions .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: |
wasm/package-lock.json

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -77,9 +74,8 @@ jobs:

test.beforeAll(async () => {
// Start a simple HTTP server
server = spawn('npx', ['serve', '-p', PORT, 'docs/book/book'], {
stdio: 'pipe',
shell: true
server = spawn('python3', ['-m', 'http.server', String(PORT), '--directory', 'docs/book/book/html'], {
stdio: 'pipe'
});
// Wait for server to start
await new Promise(resolve => setTimeout(resolve, 3000));
Expand All @@ -106,6 +102,8 @@ jobs:
test('search functionality works', async ({ page }) => {
await page.goto(BASE_URL);
// Check search is available
// mdBook keeps the search bar hidden until search is opened
await page.locator('#search-toggle').click();
const searchInput = page.locator('#searchbar');
await expect(searchInput).toBeVisible();
});
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: Publish to crates.io
on:
release:
types: [published]
# Called by release-plz.yml after it tags a release (a GITHUB_TOKEN release
# cannot trigger the `release` arm above).
workflow_call:
inputs:
tag:
required: true
type: string
workflow_dispatch:
inputs:
dry_run:
Expand All @@ -23,6 +30,8 @@ jobs:
id-token: write # Required for OIDC trusted publishing
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,51 @@ name: Update Homebrew Formula
on:
release:
types: [published]
# Called by release-plz.yml once the binaries are attached (a GITHUB_TOKEN
# release cannot trigger the `release` arm above).
workflow_call:
inputs:
tag:
required: true
type: string
secrets:
HOMEBREW_TAP_DEPLOY_KEY:
required: true
workflow_dispatch:
inputs:
version:
description: 'Version to update formula for (e.g., v0.1.0)'
required: true
type: string

# The formula lives in the tap repo, scbrown/homebrew-pixelsrc, so that
# `brew install scbrown/pixelsrc/pxl` works. CI writes to it with a deploy key
# (HOMEBREW_TAP_DEPLOY_KEY) scoped to that one repo.
env:
FORMULA_FILE: homebrew-pixelsrc/Formula/pxl.rb
FORMULA_FILE: tap/Formula/pxl.rb
# the working directory is not a pixelsrc checkout, so tell gh which repo
GH_REPO: ${{ github.repository }}

jobs:
update-formula:
name: Update Homebrew formula
runs-on: ubuntu-latest
permissions:
contents: write
contents: read
steps:
- name: Checkout
- name: Checkout the tap
uses: actions/checkout@v4
with:
ref: main
repository: scbrown/homebrew-pixelsrc
ssh-key: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}
path: tap

- name: Get version
id: version
run: |
if [ -n "${{ inputs.version }}" ]; then
if [ -n "${{ inputs.tag }}" ]; then
VERSION="${{ inputs.tag }}"
elif [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${{ github.event.release.tag_name }}"
Expand Down Expand Up @@ -88,7 +107,7 @@ jobs:
# frozen_string_literal: true

# Homebrew formula for pxl - Pixelsrc CLI
# Install: brew tap scbrown/pixelsrc && brew install pxl
# Install: brew install scbrown/pixelsrc/pxl
class Pxl < Formula
desc "GenAI-native pixel art format and compiler"
homepage "https://github.com/scbrown/pixelsrc"
Expand Down Expand Up @@ -131,9 +150,10 @@ jobs:
cat $FORMULA_FILE

- name: Commit and push
working-directory: tap
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add $FORMULA_FILE
git diff --staged --quiet || git commit -m "Update Homebrew formula for ${{ steps.version.outputs.tag }}"
git add Formula/pxl.rb
git diff --staged --quiet || git commit -m "pxl ${{ steps.version.outputs.number }}"
git push
9 changes: 7 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:

env:
CARGO_TERM_COLOR: always
# pyo3 0.23 tops out at Python 3.13; runners now carry 3.14, which
# --find-interpreter picks up. Build those against the stable ABI.
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"

jobs:
linux:
Expand All @@ -25,7 +28,9 @@ jobs:
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
# PYO3_USE_ABI3_FORWARD_COMPATIBILITY does not reach the manylinux
# container, so name the interpreters pyo3 0.23 supports.
args: --release --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
manylinux: auto
working-directory: python

Expand All @@ -41,7 +46,7 @@ jobs:
fail-fast: false
matrix:
include:
- runner: macos-13
- runner: macos-15-intel
target: x86_64-apple-darwin
- runner: macos-14
target: aarch64-apple-darwin
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release-plz

# On every push to main: open or update the release PR (version bump +
# CHANGELOG). When that PR merges: tag v<version>, create the GitHub release,
# then build the binaries, update the Homebrew tap and publish to crates.io
# from this same run.
on:
push:
branches: [main]

concurrency:
group: release-plz
cancel-in-progress: false

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: MarcoIeni/release-plz-action@v0.5
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve the new tag
id: tag
if: steps.release.outputs.releases_created == 'true'
env:
RELEASES: ${{ steps.release.outputs.releases }}
run: echo "tag=$(echo "$RELEASES" | jq -r '.[0].tag')" >> "$GITHUB_OUTPUT"

binaries:
name: Binaries
needs: release-plz
if: needs.release-plz.outputs.releases_created == 'true'
permissions:
contents: write
uses: ./.github/workflows/release.yml
with:
tag: ${{ needs.release-plz.outputs.tag }}

homebrew:
name: Homebrew tap
needs: [release-plz, binaries]
uses: ./.github/workflows/homebrew.yml
with:
tag: ${{ needs.release-plz.outputs.tag }}
secrets:
HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}

crates:
name: crates.io
needs: release-plz
if: needs.release-plz.outputs.releases_created == 'true'
permissions:
contents: read
id-token: write
uses: ./.github/workflows/crates.yml
with:
tag: ${{ needs.release-plz.outputs.tag }}
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
push:
tags:
- 'v*'
# Called by release-plz.yml after it tags a release (a GITHUB_TOKEN tag push
# cannot trigger the `tags` arm above).
workflow_call:
inputs:
tag:
required: true
type: string
workflow_dispatch:
inputs:
version:
Expand All @@ -13,7 +20,7 @@ on:

env:
CARGO_TERM_COLOR: always
VERSION: ${{ inputs.version || github.ref_name }}
VERSION: ${{ inputs.tag || inputs.version || github.ref_name }}

jobs:
build:
Expand Down Expand Up @@ -49,6 +56,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.VERSION }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -97,6 +106,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.VERSION }}

- name: Download Linux x86_64 binary
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -194,5 +205,6 @@ jobs:
with:
tag_name: ${{ env.VERSION }}
files: artifacts/*
generate_release_notes: true
# release-plz already wrote the notes from the changelog; keep them.
generate_release_notes: ${{ inputs.tag == '' }}
fail_on_unmatched_files: true
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
[![CI](https://github.com/scbrown/pixelsrc/actions/workflows/ci.yml/badge.svg)](https://github.com/scbrown/pixelsrc/actions/workflows/ci.yml)
[![Release](https://github.com/scbrown/pixelsrc/actions/workflows/release.yml/badge.svg)](https://github.com/scbrown/pixelsrc/actions/workflows/release.yml)
[![WASM](https://github.com/scbrown/pixelsrc/actions/workflows/wasm.yml/badge.svg)](https://github.com/scbrown/pixelsrc/actions/workflows/wasm.yml)
[![Version](https://img.shields.io/crates/v/pxl)](https://crates.io/crates/pxl)
[![Version](https://img.shields.io/crates/v/pixelsrc)](https://crates.io/crates/pixelsrc)
[![npm](https://img.shields.io/npm/v/@stiwi/pixelsrc-wasm)](https://www.npmjs.com/package/@stiwi/pixelsrc-wasm)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Made with pixelsrc](https://img.shields.io/badge/made%20with-pixelsrc-BD93F9)](https://pixelsrc.dev)
[![Made with pixelsrc](https://img.shields.io/badge/made%20with-pixelsrc-BD93F9)](https://scbrown.github.io/pixelsrc/)

**The first pixel art format designed for GenAI.**

Expand Down Expand Up @@ -54,12 +54,14 @@ pixelsrc is a semantic, human-readable text format for defining pixel art. Unlik
### Homebrew (macOS/Linux)

```bash
brew install scbrown/tap/pixelsrc
brew install scbrown/pixelsrc/pxl
```

### Cargo (from source)
### Cargo

```bash
cargo install pixelsrc
# or the latest main:
cargo install --git https://github.com/scbrown/pixelsrc
```

Expand Down
Loading
Loading