Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap to pnpm #102

Merged
merged 4 commits into from
Mar 8, 2024
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
69 changes: 36 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: mansona/npm-lockfile-version@v1
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- run: npm i -g npm@8
- run: npm ci
- run: npm run lint
- run: npm run test:node
- run: npm run test:ember
- run: npm run build
cache: pnpm
- run: pnpm i --frozen-lockfile
- run: pnpm run lint
- run: pnpm run test:node
- run: pnpm run test:ember
- run: pnpm run build

floating-dependencies:
name: Floating Dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- run: npm i -g npm@8
- run: npm install --no-package-lock
- run: npm run test:ember
- run: npm run build
cache: pnpm
- run: pnpm install --no-lockfile
- run: pnpm run test:ember
- run: pnpm run build

try-scenarios:
name: "ember-try: ${{ matrix.ember-try-scenario }}"
Expand All @@ -66,17 +69,17 @@ jobs:
- no-deprecations

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- run: npm i -g npm@8
- run: npm ci

- run: pnpm i --frozen-lockfile
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
- run: npm run build
run: pnpm ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
- run: pnpm run build

allow-fail-try-scenarios:
name: ${{ matrix.try-scenario }} - Allowed to fail
Expand All @@ -95,18 +98,18 @@ jobs:
- ember-release-no-deprecations

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- run: npm i -g npm@8
- run: npm ci

- run: npm run build
- run: pnpm i --frozen-lockfile
- run: pnpm run build
- name: test
id: tests
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
run: pnpm ember try:one ${{ matrix.try-scenario }} --skip-cleanup
continue-on-error: true
- uses: mainmatter/continue-on-error-comment@v1
with:
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: check-plan
permissions:
contents: write
pull-requests: write
outputs:
explanation: ${{ steps.explanation.outputs.text }}
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
Expand All @@ -43,32 +46,42 @@ jobs:
steps:
- uses: actions/checkout@v4
# We need to download lots of history so that
# lerna-changelog can discover what's changed since the last release
# github-changelog can discover what's changed since the last release
with:
fetch-depth: 0
ref: 'main'
- uses: actions/setup-node@v4
with:
node-version: 18

- run: npm ci


- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install --frozen-lockfile

- name: "Generate Explanation and Prep Changelogs"
id: explanation
run: |
set -x

npx release-plan prepare --singlePackage=guidemaker
set +e

pnpm release-plan prepare 2> >(tee -a stderr.log >&2)


echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat stderr.log >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
commit-message: "Prepare Release using 'release-plan'"
author: "github-actions[bot] <[email protected]>"
labels: "internal"
branch: release-preview
title: Prepare Release
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For every push to the master branch, this checks if the release-plan was
# updated and if it was it will publish stable npm packages based on the
# release plan
# release plan

name: Publish Stable

Expand Down Expand Up @@ -38,6 +38,9 @@ jobs:
runs-on: ubuntu-latest
needs: check-plan
if: needs.check-plan.outputs.command == 'release'
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
Expand All @@ -47,10 +50,13 @@ jobs:
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install --frozen-lockfile
- name: npm publish
run: npx release-plan publish
run: pnpm release-plan publish

env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`
* `pnpm install`

## Linting

* `npm run lint`
* `npm run lint:fix`
* `pnpm lint`
* `pnpm lint:fix`

## Running tests

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Process

Releases in this repo are mostly automated using [release-plan](https://github.com/embroider-build/release-plan/). Once you label all your PRs correctly (see below) you will have an automatically generated PR that updates your CHANGELOG.md file and a `.release-plan.json` that is used prepare the release once the PR is merged.
Releases in this repo are mostly automated using [release-plan](https://github.com/embroider-build/release-plan/). Once you label all your PRs correctly (see below) you will have an automatically generated PR that updates your CHANGELOG.md file and a `.release-plan.json` that is used to prepare the release once the PR is merged.

## Preparation

Expand Down
1 change: 1 addition & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
usePnpm: true,
scenarios: [
{
name: 'ember-lts-3.16',
Expand Down
26 changes: 25 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

const webpackConfig = {
module: {
rules: [
{
test: function (specifier) {
return !specifier.endsWith('.css') && !specifier.endsWith('.js');
},
issuer: function (issuer) {
if (issuer.endsWith('.css')) {
return true;
}
},
type: 'asset/resource',
},
],
},
};

module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
'ember-cli-uglify': {
Expand All @@ -11,7 +29,10 @@ module.exports = function (defaults) {
collapse_vars: false
}
}
}
},
autoImport: {
webpack: webpackConfig,
},
});

/*
Expand All @@ -23,6 +44,9 @@ module.exports = function (defaults) {

const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
packagerOptions: {
webpackConfig,
},
skipBabel: [
{
package: 'qunit',
Expand Down
Loading
Loading