Skip to content

Commit

Permalink
Remove yarn, use npm (#303)
Browse files Browse the repository at this point in the history
Also: upgrade some GitHub Actions.
  • Loading branch information
youngbrioche authored Jan 10, 2023
1 parent a5fffe6 commit a86037f
Show file tree
Hide file tree
Showing 7 changed files with 10,968 additions and 12,596 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [19.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -29,29 +29,29 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Setup cache for npm
id: npm_cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.npm
~/cache
!~/cache/exclude
**/node_modules
key: yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: npm install
if: steps.npm_cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- run: yarn test
run: npm install-clean
- run: npm run test

deploy_site:
if: ${{ contains(github.ref, 'refs/tags') }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [19.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -60,17 +60,17 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Setup cache for npm
id: npm_cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.npm
~/cache
!~/cache/exclude
**/node_modules
key: yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: npm install
if: steps.npm_cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: npm install-clean
- run: ./scripts/dist
env:
SKIP_RELEASE_BUNLDE: true
Expand All @@ -89,32 +89,32 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [19.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup cache for npm
id: npm_cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.npm
~/cache
!~/cache/exclude
**/node_modules
key: yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: npm install
if: steps.npm_cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: npm install --frozen-lockfile
- run: ./scripts/dist
- name: Publish to Node Packages
run: yarn publish
run: npm publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Get current tag name
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ We use git-lfs. So please install https://git-lfs.github.com/ before you clone t

Install:

yarn install
npm install

This starts a local development server complete with asset pipeline:

yarn start
npm start

Export a static site to `./dist/site`

yarn run site
npm run site

### With Docker & Docker-Compose

docker-compose up

You need to prefix all maintenance commands from above like `yarn` with
You need to prefix all maintenance commands from above like `npm` with

docker-compose run --rm web …

Expand All @@ -36,7 +36,7 @@ See `.github/workflow/build.yml` for more info.

## Generate assets locally

yarn run compile
npm run compile

After that, you'll find all the relevant assets in `./dist/`.

Expand All @@ -62,12 +62,12 @@ GitHub Actions deals with npm publishing.

### Patch level version (auto increment)

$ yarn release
$ npm release

### Minor

$ yarn release minor
$ npm release minor

### Major

$ yarn release major
$ npm release major
Loading

0 comments on commit a86037f

Please sign in to comment.