Skip to content
Open
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
137 changes: 68 additions & 69 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ executors:
node:
working_directory: ~/repo
docker:
- image: circleci/node:14.18
- image: circleci/node:14.18

# ------------------------------
# Commands
Expand All @@ -26,15 +26,15 @@ executors:
commands:
checkout-and-restore-cache:
steps:
- checkout
- restore_cache:
key: &cache-key << pipeline.parameters.cache-version >>-node14-dependencies-{{ arch }}-{{ checksum "./yarn.lock" }}
- checkout
- restore_cache:
key: &cache-key << pipeline.parameters.cache-version >>-node14-dependencies-{{ arch }}-{{ checksum "./yarn.lock" }}

set-git-write-access:
steps:
- run:
name: Setup git origin with write access
command: git remote set-url origin "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
- run:
name: Setup git origin with write access
command: git remote set-url origin "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"

# ------------------------------
# Jobs
Expand All @@ -44,57 +44,56 @@ jobs:
dependencies:
executor: node
steps:
- checkout-and-restore-cache
- run:
name: Install dependencies
command: yarn --prefer-offline --pure-lockfile --ignore-engines
- save_cache:
paths:
- ./node_modules
key: *cache-key
- checkout-and-restore-cache
- run:
name: Install dependencies
command: yarn --prefer-offline --pure-lockfile --ignore-engines
- save_cache:
paths:
- ./node_modules
key: *cache-key

unit-test:
executor: node
steps:
- checkout-and-restore-cache
- run:
name: Run tests
command: yarn test
- checkout-and-restore-cache
- run:
name: Run tests
command: yarn test

build:
executor: node
steps:
- checkout-and-restore-cache
- run:
name: Build sources
command: yarn build
- persist_to_workspace:
root: ~/repo
paths:
- dist
- checkout-and-restore-cache
- run:
name: Build sources
command: yarn build
- persist_to_workspace:
root: ~/repo
paths:
- dist

dry-release:
executor: node
steps:
- checkout-and-restore-cache
- attach_workspace:
at: ~/repo
- set-git-write-access
- run:
name: Create release
command: yarn semantic-release --dry-run --branch ${CIRCLE_BRANCH}
- checkout-and-restore-cache
- attach_workspace:
at: ~/repo
- set-git-write-access
- run:
name: Create release
command: yarn semantic-release --dry-run --branch ${CIRCLE_BRANCH}

release:
executor: node
steps:
- checkout-and-restore-cache
- attach_workspace:
at: ~/repo
- set-git-write-access
- run:
name: Create release
command: yarn semantic-release

- checkout-and-restore-cache
- attach_workspace:
at: ~/repo
- set-git-write-access
- run:
name: Create release
command: yarn semantic-release

# ------------------------------
# Workflow
Expand All @@ -103,29 +102,29 @@ jobs:
workflows:
main-workflow:
jobs:
- dependencies
- unit-test:
requires:
- dependencies
- build:
requires:
- dependencies
- dry-release:
context: NpmReleasePublish
requires:
- unit-test
- build
- hold-release:
type: approval
filters:
branches:
only: main
- release:
context: NpmReleasePublish
requires:
- unit-test
- build
- hold-release
filters:
branches:
only: main
- dependencies
- unit-test:
requires:
- dependencies
- build:
requires:
- dependencies
- dry-release:
context: NpmReleasePublish
requires:
- unit-test
- build
- hold-release:
type: approval
filters:
branches:
only: main
- release:
context: NpmReleasePublish
requires:
- unit-test
- build
- hold-release
filters:
branches:
only: main
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

/*.d.ts
!/interfaces.d.ts
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHANGELOG.md
dist/
10 changes: 5 additions & 5 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"printWidth": 100
}
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"printWidth": 100
}
Loading