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

chore: Bump test/package-lock version automatically #83

Merged
merged 4 commits into from
Nov 15, 2022
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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
name: coverage
path: test/coverage/
- name: Release Dry Run
run: |
npx commit-and-tag-version --dry-run
run: npx commit-and-tag-version --commit-all --dry-run
- name: Archive test results on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
git config user.email "$GIT_AUTHOR_EMAIL"
git checkout main
npm install
npx commit-and-tag-version
npx commit-and-tag-version --commit-all
git push --follow-tags origin main
npm publish
4 changes: 4 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
scripts: {
// Update version number in test/package-lock.json
postbump: "npm run pack && git add test/package-lock.json",
},
types: [
{ type: "feat", section: "Features" },
{ type: "fix", section: "Bug Fixes" },
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"format:fix": "prettier --write .",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "npm run format && npm run lint && ./test/go.sh"
"test": "npm run format && npm run lint && ./test/go.sh",
"pack": "./test/pack.sh"
},
"devDependencies": {
"commit-and-tag-version": "^10.1.0",
Expand Down
15 changes: 4 additions & 11 deletions test/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
set -euxo pipefail

# Create tarball from package
cd "$(dirname "$0")"
cd ..
rm -rf dist/
mkdir dist/
npm pack --pack-destination dist/
find dist
mv dist/*.tgz dist/playwright-test-coverage.tgz
find dist
npm run pack

# Install tarball in test folder
cd "$(dirname "$0")"
npm install ../dist/playwright-test-coverage.tgz
# Change into script folder
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"

# If CI is set, install dependencies
if [ -n "${CI-}" ]; then
Expand Down
17 changes: 17 additions & 0 deletions test/pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euxo pipefail

# Create tarball from package
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"
cd ..
rm -rf dist/
mkdir dist/
npm pack --pack-destination dist/
find dist
mv dist/*.tgz dist/playwright-test-coverage.tgz
find dist

# Install tarball in test folder
cd "$SCRIPT_DIR"
npm install ../dist/playwright-test-coverage.tgz
4 changes: 2 additions & 2 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.