From 612f80b65f12a4880907a24886c2b74ede8dbe22 Mon Sep 17 00:00:00 2001 From: Sergey Astapov Date: Wed, 27 Dec 2023 14:54:45 -0500 Subject: [PATCH] Drop support for Ember.js 4.4 and below --- .github/workflows/ci.yml | 7 ++--- .github/workflows/publish.yml | 46 +++++++++++++++++++++++++++++++++ .github/workflows/push-dist.yml | 25 ++++++++++++++++++ test-app/config/ember-try.js | 42 +++--------------------------- 4 files changed, 77 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/push-dist.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c3bb8a..afa13c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,14 +68,11 @@ jobs: fail-fast: false matrix: try-scenario: - - ember-lts-3.16 - - ember-lts-3.20 - - ember-lts-3.24 - - ember-lts-3.28 + - ember-lts-4.8 + - ember-lts-4.12 - ember-release - ember-beta - ember-canary - - ember-classic - embroider-safe - embroider-optimized diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..95db387 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Publish + +on: + push: + branches: + - main + - master + tags: + - v* + +jobs: + publish: + name: Publish + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8.x + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'pnpm' + # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable + registry-url: 'https://registry.npmjs.org' + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + # We need a workspace aware version of npm because our addon is in a subdir but our .npmrc is in the root + - name: npm8 + run: npm install -g npm@8 + + # We need a workspace aware version of npm because our addon is in a subdir but our .npmrc is in the root + - name: copy .md files + run: cp README.md LICENSE.md CHANGELOG.md addon/ + + - name: npm publish + run: npm publish --tag=latest --verbose --workspace=addon + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/push-dist.yml b/.github/workflows/push-dist.yml new file mode 100644 index 0000000..5781b27 --- /dev/null +++ b/.github/workflows/push-dist.yml @@ -0,0 +1,25 @@ +# Because this library needs to be built, +# we can't easily point package.json files at the git repo for easy cross-repo testing. +# +# This workflow brings back that capability by placing the compiled assets on a "dist" branch +# (configurable via the "branch" option below) +name: Push dist + +on: + push: + branches: + - main + - master + +jobs: + push-dist: + name: Push dist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: wyvox/action-setup-pnpm@v3 + - uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0 + with: + branch: dist + token: ${{ secrets.GITHUB_TOKEN }} + working-directory: addon diff --git a/test-app/config/ember-try.js b/test-app/config/ember-try.js index a145dc8..b3bcce1 100644 --- a/test-app/config/ember-try.js +++ b/test-app/config/ember-try.js @@ -8,34 +8,18 @@ module.exports = async function () { usePnpm: true, scenarios: [ { - name: 'ember-lts-3.16', + name: 'ember-lts-4.8', npm: { devDependencies: { - 'ember-source': '~3.16.10', + 'ember-source': '~4.8.0', }, }, }, { - name: 'ember-lts-3.20', + name: 'ember-lts-4.12', npm: { devDependencies: { - 'ember-source': '~3.20.7', - }, - }, - }, - { - name: 'ember-lts-3.24', - npm: { - devDependencies: { - 'ember-source': '~3.24.3', - }, - }, - }, - { - name: 'ember-lts-3.28', - npm: { - devDependencies: { - 'ember-source': '~3.28.0', + 'ember-source': '~4.12.0', }, }, }, @@ -63,24 +47,6 @@ module.exports = async function () { }, }, }, - { - name: 'ember-classic', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ - 'application-template-wrapper': true, - 'default-async-observers': false, - 'template-only-glimmer-components': false, - }), - }, - npm: { - devDependencies: { - 'ember-source': '~3.28.0', - }, - ember: { - edition: 'classic', - }, - }, - }, embroiderSafe(), embroiderOptimized(), ],