diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..31cf210 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test: + name: Lint, Build, Test + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build + + - name: Run tests + run: npm run test:ember + + floating-deps: + name: Floating Dependencies + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install latest deps (no lockfile) + run: npm install --no-package-lock + + - name: Run tests + run: npm run test:ember + + try-scenarios: + name: 'Try: ${{ matrix.scenario }}' + runs-on: ubuntu-latest + needs: test + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + scenario: + - ember-lts-4.4.5 + - ember-lts-4.8.6 + - ember-lts-4.12.3 + include: + # Allow these to fail without failing the workflow. + # ember-release is included here (rather than as a hard requirement) + # because the addon is currently pinned to the Ember 4.12 line; the + # Ember 5/6 jump is tracked separately. + - scenario: ember-release + allow-failure: true + - scenario: ember-beta + allow-failure: true + - scenario: ember-canary + allow-failure: true + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run ember-try scenario + run: npx ember try:one ${{ matrix.scenario }} --skip-cleanup + continue-on-error: ${{ matrix.allow-failure == true }} diff --git a/.npmignore b/.npmignore index bd09adf..8da3811 100644 --- a/.npmignore +++ b/.npmignore @@ -13,13 +13,15 @@ /.eslintignore /.eslintrc.js /.git/ +/.github/ /.gitignore /.template-lintrc.js -/.travis.yml /.watchmanconfig /bower.json /config/ember-try.js /CONTRIBUTING.md +/AGENTS.md +/RELEASING.md /ember-cli-build.js /testem.js /tests/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 345135f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -language: node_js -node_js: - # we recommend testing addons with the same minimum supported node version as Ember CLI - # so that your addon works for all apps - - "10" - -dist: xenial - -addons: - chrome: stable - -cache: - directories: - - $HOME/.npm - -env: - global: - # See https://git.io/vdao3 for details. - - JOBS=1 - -branches: - only: - - master - # npm version tags - - /^v\d+\.\d+\.\d+/ - -jobs: - fast_finish: true - allow_failures: - - env: EMBER_TRY_SCENARIO=ember-canary - - include: - # runs linting and tests with current locked deps - - stage: "Tests" - name: "Tests" - script: - - npm run lint - - npm run test:ember - - - stage: "Additional Tests" - name: "Floating Dependencies" - install: - - npm install --no-package-lock - script: - - npm run test:ember - - # we recommend new addons test the current and previous LTS - # as well as latest stable release (bonus points to beta/canary) - - env: EMBER_TRY_SCENARIO=ember-lts-4.4.5 - - env: EMBER_TRY_SCENARIO=ember-lts-4.8.6 - - env: EMBER_TRY_SCENARIO=ember-lts-4.12.3 - - env: EMBER_TRY_SCENARIO=ember-release - - env: EMBER_TRY_SCENARIO=ember-beta - - env: EMBER_TRY_SCENARIO=ember-canary - - env: EMBER_TRY_SCENARIO=ember-default-with-jquery - - env: EMBER_TRY_SCENARIO=ember-classic - -script: - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/AGENTS.md b/AGENTS.md index 96021f0..e6f507f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -177,7 +177,9 @@ npm run lint:js npm run lint:hbs ``` -CI runs on Travis (`.travis.yml`). +CI runs on GitHub Actions (`.github/workflows/ci.yml`) — runs lint, +build, tests, and the ember-try compatibility matrix on every PR and +on pushes to `main`. --- @@ -254,10 +256,12 @@ them or at least don't regress them. ## 9. Release / publishing -This is a public npm package. Publishing is **not** automated in this -repo — do not run `npm publish` from an agent without explicit user -confirmation. Version bumps go in `package.json`. Update the README -"thanks" section and any breaking-change notes. +This is a public npm package distributed via +. The full release +procedure is documented in [`RELEASING.md`](./RELEASING.md). + +Publishing is **not** automated — do not run `npm publish` or +`npm version` from an agent without explicit user confirmation. --- diff --git a/README.md b/README.md index fbdca09..69b56f5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Ember CLI Raygun -[![Build Status](https://travis-ci.org/MindscapeHQ/ember-cli-raygun.svg?branch=master)](https://travis-ci.org/MindscapeHQ/ember-cli-raygun) +[![CI](https://github.com/MindscapeHQ/ember-cli-raygun/actions/workflows/ci.yml/badge.svg)](https://github.com/MindscapeHQ/ember-cli-raygun/actions/workflows/ci.yml) [![Ember Observer Score](http://emberobserver.com/badges/ember-cli-raygun.svg)](http://emberobserver.com/addons/ember-cli-raygun) This addon will allow you to report errors to [Raygun](https://raygun.com) from your Ember CLI app using [raygun4js](https://github.com/MindscapeHQ/raygun4js). diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..feab7ce --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,154 @@ +# Releasing ember-cli-raygun + +This package is published to **[npm](https://www.npmjs.com/package/ember-cli-raygun)** +as `ember-cli-raygun`. GitHub holds source only — consumers install via +`ember install ember-cli-raygun` (which is just `npm install` under the hood), +so npm is the actual distribution channel. There is no other host or registry +to push to. + +## Prerequisites + +Before you can release, you need: + +1. **npm publish access** to the `ember-cli-raygun` package. Verify with: + ```bash + npm owner ls ember-cli-raygun + ``` + If you're not on the list, ask an existing owner to grant access: + ```bash + npm owner add ember-cli-raygun + ``` + +2. **`npm login`** with that account on your local machine. Verify with: + ```bash + npm whoami + ``` + +3. **2FA enabled** on the npm account (recommended). If `npm publish` later + prompts for a one-time password, that's why. + +4. **A clean working tree** on the `main` branch with the merge of the change + you want to release already pulled. + +## Versioning + +This project follows [SemVer](https://semver.org/): + +- **Patch** (`2.0.0 → 2.0.1`) — bug fixes, internal refactors, dependency + bumps, test-only changes, doc-only changes. +- **Minor** (`2.0.0 → 2.1.0`) — new features that are backwards-compatible + to consumers (e.g. a new service method, new config option that defaults + to current behavior). +- **Major** (`2.0.0 → 3.0.0`) — breaking changes to the public API + (service signature, config keys, supported Ember/Node range, removed + features). + +When in doubt, ask: *"Will an existing app that upgrades by running +`npm install ember-cli-raygun@latest` need to change any code?"* If yes, +it's a major. + +## Release steps + +```bash +# 1. Make sure main is up to date and clean +git checkout main +git pull --ff-only origin main +git status # should be clean + +# 2. Bump the version. Choose ONE of: +npm version patch # 2.0.0 -> 2.0.1 +npm version minor # 2.0.0 -> 2.1.0 +npm version major # 2.0.0 -> 3.0.0 + +# This automatically: +# - bumps "version" in package.json + package-lock.json +# - creates a commit "v2.0.1" (or whatever) +# - creates a git tag v2.0.1 + +# 3. Push the commit and the tag +git push origin main --follow-tags + +# 4. Publish to npm +npm publish + +# (If your account requires 2FA: it will prompt for a one-time password.) + +# 5. Create a GitHub Release on the new tag +# https://github.com/MindscapeHQ/ember-cli-raygun/releases/new +# - Choose the new tag (e.g. v2.0.1) +# - Title it the same (v2.0.1) +# - Paste the changelog entry from the merged PRs since the last release +``` + +## What gets published + +Files included in the npm package are controlled by [`.npmignore`](./.npmignore). +At time of writing the published tarball contains: + +- `addon/` — runtime source +- `app/` — host-namespace re-exports +- `blueprints/` — `ember install` scaffolding +- `config/environment.js` — addon's own ember-cli config +- `index.js` — build-time addon entry point +- `package.json` +- `README.md` +- `LICENSE.md` + +Excluded: `tests/`, `dist/`, `tmp/`, all dotfiles, ember-try artifacts, +CI configs, `CONTRIBUTING.md`, `RELEASING.md`, `AGENTS.md`, +`ember-cli-build.js`, `testem.js`. + +You can preview the exact tarball **without** publishing using: + +```bash +npm pack --dry-run +``` + +## Pre-flight checklist + +Before running `npm publish`, double-check: + +- [ ] `npm run lint` passes +- [ ] `npm run test:ember` passes (or CI on the merge commit is green) +- [ ] `npm run build` succeeds +- [ ] `npm pack --dry-run` lists only the files you intend to ship +- [ ] The version in `package.json` matches the git tag you just created +- [ ] The README and any user-facing docs reflect what's in the release +- [ ] If this is a breaking change: the README has a migration note + +## After publishing + +- Verify the new version is live: `npm view ember-cli-raygun version` should + echo what you just published. It can take ~30 seconds for the npm CDN to + catch up. +- Verify a fresh install works in a scratch project: + ```bash + cd $(mktemp -d) && npm init -y && npm install ember-cli-raygun@latest + ``` +- Announce on whatever channels you use (changelog, internal Slack, etc.). + +## Recovering from a bad release + +If you publish something broken: + +- **Within 72 hours**, you can `npm unpublish ember-cli-raygun@`. + After 72 hours, npm will not let you unpublish. +- **Always preferred**: publish a follow-up patch release with the fix and + optionally `npm deprecate ember-cli-raygun@ ""` so + installers see a warning. Existing consumers' lockfiles continue to work, + but new installs get the fix. + +## Future: automated releases + +This repo currently releases manually. A future improvement would be to add +a `.github/workflows/release.yml` that triggers on `v*` tag pushes and runs +`npm publish` using a granular access token stored as a `NPM_TOKEN` repo +secret. That would reduce the steps above to: + +```bash +npm version patch +git push origin main --follow-tags +# CI publishes automatically +``` + +Not implemented yet — track in an issue if/when there's appetite. diff --git a/config/ember-try.js b/config/ember-try.js index a311e43..5d16cc3 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -53,34 +53,13 @@ module.exports = async function () { } } }, - { - name: 'ember-default-with-jquery', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ - 'jquery-integration': true - }) - }, - npm: { - devDependencies: { - '@ember/jquery': '^1.1.0' - } - } - }, - { - name: 'ember-classic', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ - 'application-template-wrapper': true, - 'default-async-observers': false, - 'template-only-glimmer-components': false - }) - }, - npm: { - ember: { - edition: 'classic' - } - } - } + // The 'ember-classic' scenario was removed: the Ember Classic edition + // was removed from Ember itself, so the scenario can never pass on a + // modern Ember version. See deprecations.emberjs.com/v3.x/#toc_editions-classic + // + // The 'ember-default-with-jquery' scenario was also removed: the + // 'jquery-integration' optional feature was removed in Ember 4.0. + // See deprecations.emberjs.com/v3.x/#toc_optional-feature-jquery-integration ] }; };