Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Migrate to yarn (#38)
Browse files Browse the repository at this point in the history
* Migrate to yarn

* Mention yarn in README

* Use only node 10 to satisfy yarn install

* Add ignore-engine flag and restore 12.x node

* Rename action steps

* Update README
  • Loading branch information
Florian Richter authored Jan 7, 2020
1 parent 4a90bd4 commit 9c57fa6
Show file tree
Hide file tree
Showing 7 changed files with 6,666 additions and 10,601 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '10.x'
- name: Deploy a stable release to NPM
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
npm whoami
npm ci
yarn install --frozen-lockfile
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 9 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
- name: Get yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Save/restore yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
run: yarn install --frozen-lockfile --ignore-engines
- name: Run tests
run: npm test
run: yarn test
env:
CI: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/dist
/lib
/tmp
/yarn.lock
node_modules
.idea
test/**/*spec/*
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ The CLI is based on [oclif](https://oclif.io/docs/introduction.html) and can be
If you think your plugin should be part of the CLI itself, feel free to [open a pull request](https://github.com/SAP/cloud-sdk-cli/compare).
If you have found a bug in our existing functionality, please [open an issue](https://github.com/SAP/cloud-sdk-cli/issues/new/choose).

### Package Manager

This repository uses [yarn](https://yarnpkg.com/) as a package manager.
This is only relevant for the development of the CLI.
Projects that use the CLI are free to use any package manager as long as a `package.json` is present.

### Release

The easiest way to create a new release is running
Expand All @@ -334,9 +340,9 @@ The easiest way to create a new release is running
$ npx np
```

This will test the code, run any prepublish steps, increase the version as selected by the user and create a draft release in github.
This will test the code, run any pre-publish steps, increase the version as selected by the user and create a draft release in github.
Afterwards fill in the release notes and press "Publish release".
This will trigger the github action and a new release will be published on npm automatically.
This will trigger the github action and a new release will be published on `npm` automatically.

## License

Expand Down
Loading

0 comments on commit 9c57fa6

Please sign in to comment.