Skip to content

Commit

Permalink
Add back Makefile, remove ccu from GH Actions publish (#2446)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Sep 18, 2023
1 parent 4be7432 commit 095ba2b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 21,605 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,19 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci
run: yarn

- name: Build release
run: rm -rf dist && rm -rf build && npm run dist && npm run build

run: rm -rf dist && rm -rf build && yarn dist build
- name: Publish release to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish release to CDN
run: ccu --trace

publish-gh:
needs: publish-npm # Don't publish to GitHub Packages until NPM is done

Expand All @@ -60,13 +56,13 @@ jobs:
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache: 'yarn'

- name: Install dependencies
run: npm ci
run: yarn

- name: Build release
run: rm -rf dist && rm -rf build && npm run dist && npm run build
run: rm -rf dist && rm -rf build && yarn dist build

- name: Publish release to GitHub Packages
run: npm publish
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: 'yarn'

- name: Install dependencies
run: npm ci
run: yarn

- name: Build package
run: npm run build
run: yarn build

- name: Run `es-check`
run: npm run test:es-check
run: yarn test:es-check

- name: Run `i18n:validate`
run: npm run i18n:validate
run: yarn i18n:validate

- name: Run Jest unit tests
run: npm run test
run: yarn test

- name: Run Karma end-to-end tests
run: npm run test:e2e
run: yarn test:e2e

- name: Upload coverage
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # [email protected]
2 changes: 1 addition & 1 deletion .shiprc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"files": {
"README.md": []
},
"postbump": "npm run dist && npm run build"
"postbump": "yarn dist build"
}
16 changes: 8 additions & 8 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,39 @@ The SDK uses [Webpack](https://webpack.js.org/) to compile all JavaScript assets
To perform a build, use the `build` script:

```
npm run build
yarn build
```

## Running Tests

Unit tests can be executed using [Jest](https://jestjs.io/) by issuing the following command:

```
npm run test
yarn test
```

To interactively perform tests using Jest's `watch` mode, use:

```
npm run test:watch
yarn test:watch
```

End-to-end tests can be executed locally using [Karma](https://karma-runner.github.io/), in both watch and CLI mode:

```
# CLI mode using Chrome Headless browser:
npm run test:e2e
yarn test:e2e
# Watch mode using Chrome desktop browser, in watch mode:
npm run test:e2e:watch
yarn test:e2e:watch
```

## The SDK Playground

To test the SDK manually and play around with the various options and features, you can invoke the Playground by using:

```
npm start
yarn start
```

Next, open `https://localhost:3000/support`, which will display a simple web app that allows you to interact with Auth0 to test functionality. The HTML template in `support/index.html` can be modified to test various different pieces of functionality.
Expand All @@ -58,7 +58,7 @@ You can then use another SPA app to log in using this tenant that has this custo

You may need to run Lock using HTTPS with a valid certificate if you want to do this testing in Safari, as Safari will not load mixed content pages, and will also not load HTTPS with untrusted testing certificates.

Lock can already support HTTPS just by running `npm start` if you have `mkcert` installed.
Lock can already support HTTPS just by running `yarn start` if you have `mkcert` installed.

To install `mkcert`:

Expand All @@ -70,7 +70,7 @@ brew install nss # if you use Firefox
mkcert install
# Serve lock
npm start
yarn start
```

Once Lock has started, use another SPA app to log in using a tenant with the template customized as above.
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env make

#SHELL := /bin/bash
#.SHELLFLAGS = -ec

.PHONY: install lint test build cdn-publish

install:
@echo "Running install..."
yarn install

test:
@echo "Running test..."
yarn test

build:
@echo "Running build..."
rm -rf dist && rm -rf build && yarn dist build

publish:
@echo "Running cdn-publish..."
yarn publish:cdn
Loading

0 comments on commit 095ba2b

Please sign in to comment.