Skip to content

Commit

Permalink
feat: automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidobo committed Sep 2, 2022
1 parent b0bcc37 commit 97a81d9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 4 deletions.
72 changes: 69 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,47 @@ jobs:
steps:
- attach_workspace:
at: .
- node/install:
install-yarn: true
- run:
name: Run tests
command: yarn test-node-unit
- store_test_results:
path: ./
release-pr:
executor: node/default
steps:
- attach_workspace:
at: .
- run:
name: Install release-please
command: npm i release-please -g
- run:
name: Create or update release PR
command: release-please release-pr --token=${GH_TOKEN} --repo-url=sandworm-hq/sandworm-js
github-release:
executor: node/default
steps:
- attach_workspace:
at: .
- run:
name: Install release-please
command: npm i release-please -g
- run:
name: Create release
command: release-please github-release --token=${GH_TOKEN} --repo-url=sandworm-hq/sandworm-js
publish-npm:
executor: node/default
steps:
- attach_workspace:
at: .
- run:
name: Auth With NPM
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Publish to NPM
command: npm publish

workflows:
test:
test-n-publish:
jobs:
- setup
- lint:
Expand All @@ -104,12 +135,21 @@ workflows:
- test-unit:
requires:
- build
filters:
tags:
ignore: /^v.*/
- test-web:
requires:
- build
filters:
tags:
ignore: /^v.*/
- test-node:
requires:
- build
filters:
tags:
ignore: /^v.*/
matrix:
parameters:
version:
Expand All @@ -132,3 +172,29 @@ workflows:
- "17.9"
# - "18.0"
# - "18.4"
- github-release:
requires:
- test-unit
- test-web
- test-node
filters:
branches:
only: main
tags:
ignore: /^v.*/
- release-pr:
requires:
- github-release
filters:
branches:
only: main
tags:
ignore: /^v.*/
- publish-npm:
requires:
- build
filters:
branches:
only: main
tags:
only: /^v.*/
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"release-type": "node",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"draft": true,
"prerelease": false
}
}
Expand Down

0 comments on commit 97a81d9

Please sign in to comment.