diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml new file mode 100644 index 0000000..ac240c7 --- /dev/null +++ b/.github/workflows/auto-pr.yml @@ -0,0 +1,81 @@ +name: Open pull request + +on: + push: + branches: + - "**" + +permissions: + contents: read + +jobs: + open-pull-request: + if: >- + github.ref_type == 'branch' && + github.ref_name != github.event.repository.default_branch && + github.actor != 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Open a pull request for this branch + uses: actions/github-script@v8 + with: + script: | + const { owner, repo } = context.repo; + const branch = context.ref.replace(/^refs\/heads\//, ""); + const base = context.payload.repository.default_branch; + const existing = await github.rest.pulls.list({ + owner, + repo, + state: "open", + head: `${owner}:${branch}`, + base, + per_page: 1, + }); + + if (existing.data.length > 0) { + core.info(`Pull request #${existing.data[0].number} already exists for ${branch}.`); + return; + } + + const commits = context.payload.commits ?? []; + const subjects = commits + .map(({ message }) => message.split(/\r?\n/, 1)[0].trim()) + .filter(Boolean); + const latestSubject = context.payload.head_commit?.message + ?.split(/\r?\n/, 1)[0] + ?.trim(); + const title = (latestSubject || `${branch}: automated pull request`).slice(0, 250); + const changes = subjects.length + ? subjects.map((subject) => `- ${subject}`).join("\n") + : `- Changes pushed to \`${branch}\`.`; + const body = [ + "## What changed?", + "", + changes, + "", + "## Why?", + "", + `Automatically opened for the \`${branch}\` branch. See the commits above for context.`, + "", + "## Validation", + "", + "CI runs automatically on this pull request.", + "", + "## Release impact", + "", + "Review whether package manifests, release assets, or hosted repositories are affected.", + ].join("\n"); + + const pullRequest = await github.rest.pulls.create({ + owner, + repo, + head: branch, + base, + title, + body, + draft: false, + }); + core.info(`Opened ${pullRequest.data.html_url}`); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56bb7eb..fa38f6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,3 +36,29 @@ jobs: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@1.85.0 - run: cargo test --locked + + website: + name: Website checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + cache-dependency-path: site/package-lock.json + - run: npm ci + working-directory: site + - name: Check generated installer is in sync + run: | + npm run sync-installer + git -C .. diff --exit-code -- site/app/yo-setup/installer.generated.ts + working-directory: site + - run: npm run lint + working-directory: site + - run: ./node_modules/.bin/tsc --noEmit --incremental false + working-directory: site + - run: npm run build + working-directory: site + env: + NEXT_TELEMETRY_DISABLED: 1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6c53a5..b400e93 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,9 @@ cargo run -- --fast --name YourName - Run `cargo fmt`, `cargo test`, and `cargo clippy -- -D warnings`. - Update the README and changelog when users will notice the change. +Pushing a branch other than the default branch automatically opens a pull request. +Push additional commits to update that pull request; Dependabot branches are excluded. + ## Community tip packs Tip packs are YAML files. Keep them practical, short, original, and safe for a broad developer audience. diff --git a/README.md b/README.md index f51e03f..c565a34 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,11 @@ Choose one method. The full platform notes and verification steps are in [docs/i | Channel | Install | Status | | --- | --- | --- | +| Arch / AUR | `yay -S yoo-bin` or `paru -S yoo-bin` | Community package | | APT (Debian/Ubuntu) | `curl -fsSL https://yo-cli.vercel.app/apt/setup.sh \| sudo sh` then `sudo apt install yoo` | Self-hosted signed repository | | DNF (Fedora/RHEL) | `sudo dnf config-manager addrepo --from-repofile=https://yo-cli.vercel.app/rpm/yoo.repo` then `sudo dnf install yoo` | Self-hosted signed repository | | Alpine | Add `https://yo-cli.vercel.app/alpine` to `/etc/apk/repositories`, then `sudo apk add yoo` | Self-hosted APK repository | | openSUSE Tumbleweed | `sudo zypper ar -f https://yo-cli.vercel.app/opensuse yoo && sudo zypper refresh && sudo zypper install yoo` | Self-hosted signed repository | -| Arch / AUR | `yay -S yoo-bin` | Community package | | Nix | `nix run github:nihitdev/yo-cli` | GitHub flake | | Flatpak | `flatpak remote-add --user yoo https://yo-cli.vercel.app/flatpak/yoo.flatpakrepo && flatpak install --user yoo io.github.nihitdev.yoo` | Self-hosted repository | | Cargo Binstall | `cargo binstall yoo` | Prebuilt GitHub Release binary | diff --git a/docs/installation.md b/docs/installation.md index d9c82cb..320de71 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -112,13 +112,14 @@ older glibc systems should use Cargo or Nix. ## Arch Linux / AUR -The binary package is prepared for publication as `yoo-bin`: +Install the `yoo-bin` package from the AUR with either helper: ```bash yay -S yoo-bin +# or +paru -S yoo-bin ``` -This requires the maintainer to publish the AUR repository first. You can build it now from this checkout: ```bash diff --git a/packaging/README.md b/packaging/README.md index 2150fbc..017a509 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -37,11 +37,11 @@ changing completions, run `cargo build --release --locked` followed by - **Homebrew:** create `nihitdev/homebrew-tap` with an initial default branch. Optional `HOMEBREW_TAP_TOKEN` needs contents-write access to that repository. The release job commits only `Formula/yoo.rb`. Without the secret it skips. -- **AUR:** register an account and SSH key, request/create `yoo-bin`, and store - the deploy key as `AUR_SSH_PRIVATE_KEY`. The release job then copies the - generated `PKGBUILD` and `.SRCINFO`, validates the package metadata, and - pushes the AUR checkout. Without the secret, the release bundle remains ready - for manual review and upload. +- **AUR:** the release workflow updates the existing `yoo-bin` package using + `AUR_SSH_PRIVATE_KEY`. When setting up a fork, register an AUR account, add + its SSH key, and save the private deploy key as that secret. Without the + secret, the release bundle still includes the generated package metadata for + manual review and upload. - **Snap:** Snap Store publishing is currently disabled. Packaging CI still builds, smoke-tests, and attaches the `.snap` artifact to each GitHub Release. - **Flatpak:** bundles require no account. A Flathub submission would require diff --git a/site/app/page.tsx b/site/app/page.tsx index 0954441..bb9d2d9 100644 --- a/site/app/page.tsx +++ b/site/app/page.tsx @@ -3,6 +3,7 @@ import { SiteExtras } from "./SiteExtras"; import Image from "next/image"; const installs = [ + { label: "Arch / AUR", command: "yay -S yoo-bin\n# or\nparu -S yoo-bin" }, { label: "Installer", command: "curl --proto '=https' --tlsv1.2 -LsSf https://yo-cli.vercel.app/yo-setup | sh" }, { label: "APT", command: "curl -fsSL https://yo-cli.vercel.app/apt/setup.sh | sudo sh\nsudo apt install yoo" }, { label: "DNF", command: "sudo dnf config-manager addrepo --from-repofile=https://yo-cli.vercel.app/rpm/yoo.repo\nsudo dnf install yoo" },