Skip to content

Commit

Permalink
Support releasing via git tags & ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Apr 4, 2024
1 parent 4e95a93 commit da5b2fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.yarn
website/.yarn
dist/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
Expand All @@ -41,6 +43,13 @@ jobs:
- name: Test
run: |
corepack yarn test
- name: Release
if: startsWith(github.ref, 'refs/tags/')
run: |
cd dist/
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Website Build
if: github.ref == 'refs/heads/main'
run: |
Expand Down
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@
},
"readmeFilename": "README.md",
"scripts": {
"beautify": "env INVIG_PRETTIER=1 invig --src src",
"browser:bundle": "browserify test/browser/app.js --outfile test/browser/bundle.js",
"browser:watch": "budo test/browser/app.js --live --serve test/browser/bundle.js",
"build:dist": "babel src --out-dir dist --source-maps && cp package.json dist/",
"build:dist": "babel src --out-dir dist --source-maps && cp package.json dist/ && cd dist/ && yarn",
"build:indices": "babel-node src/_util/cli.js reindex",
"build:tests:noskip": "rimraf test/languages && babel-node src/_util/cli.js writetests --noskip",
"build:tests": "rimraf test/languages && babel-node src/_util/cli.js writetests",
Expand All @@ -81,10 +80,6 @@
"lint:js": "eslint --ext .js,.jsx,.ts,.tsx .",
"lint": "npm-run-all --parallel 'lint:**'",
"playground:start": "cd test/browser && babel-node server.js",
"release:major": "cross-env SEMANTIC=major yarn release",
"release:minor": "cross-env SEMANTIC=minor yarn release",
"release:patch": "cross-env SEMANTIC=patch yarn release",
"release": "git commit CHANGELOG.md -m 'Update CHANGELOG.md' && npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push --tags && git push && yarn build:dist && cd dist && npm publish",
"test:languages:noskip": "yarn build:tests:noskip && cross-env DEBUG='locutus:*' mocha --compilers js:babel-register --reporter spec --recursive test/languages --grep \"${TEST_GREP:-}\"",
"test:languages": "yarn build:tests && cross-env DEBUG='locutus:*' mocha --compilers js:babel-register --reporter spec --recursive test/languages --grep \"${TEST_GREP:-}\"",
"test:module": "babel-node test/module/module.js",
Expand Down

0 comments on commit da5b2fd

Please sign in to comment.