Skip to content

Commit

Permalink
ci setup for npm publishing #46 (#62)
Browse files Browse the repository at this point in the history
* ci

* fix esl path

* revert eslint path

---------

Co-authored-by: deimantas Jakovlevas <[email protected]>
  • Loading branch information
nyan-left and nyan-left authored Oct 26, 2023
1 parent 2821cd1 commit 4647e09
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
# TODO: Add back in after linting issues have been resolved.
# - run: npm lint
- run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions pcsync.js → bin/pcsync.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env node

const OverwriteAllLocalWithRemote = require('./src/sync-commands/overwrite-all-local-with-remote');
const OverwriteAllRemoteWithLocal = require('./src/sync-commands/overwrite-all-remote-with-local');
const CUtils = require('./src/utils/common-utils');
const SyncUtils = require('./src/sync-commands/sync-utils');
const SCUtils = require('./src/sync-commands/sync-command-utils');
const OverwriteAllLocalWithRemote = require('../src/sync-commands/overwrite-all-local-with-remote');
const OverwriteAllRemoteWithLocal = require('../src/sync-commands/overwrite-all-remote-with-local');
const CUtils = require('../src/utils/common-utils');
const SyncUtils = require('../src/sync-commands/sync-utils');
const SCUtils = require('../src/sync-commands/sync-command-utils');

const program = require('commander');

Expand Down
16 changes: 8 additions & 8 deletions pcwatch.js → bin/pcwatch.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env node

const GetConfig = require('./src/utils/get-config');
const GetConfig = require('../src/utils/get-config');
const program = require('commander');

const CUtils = require('./src/utils/common-utils');
const WatchUtils = require('./src/watch-actions/watch-utils');
const ActionCreated = require('./src/watch-actions/action-created');
const SyncUtils = require('./src/sync-commands/sync-utils');
const LocalWatcher = require('./src/utils/local-watcher');
const CacheUtils = require('./src/utils/cache-utils');
const LocalTraversal = require('./src/utils/local-traversal');
const CUtils = require('../src/utils/common-utils');
const WatchUtils = require('../src/watch-actions/watch-utils');
const ActionCreated = require('../src/watch-actions/action-created');
const SyncUtils = require('../src/sync-commands/sync-utils');
const LocalWatcher = require('../src/utils/local-watcher');
const CacheUtils = require('../src/utils/cache-utils');
const LocalTraversal = require('../src/utils/local-traversal');

program.option('-f, --force', 'skip local/remote equality check');

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"sync",
"local"
],
"files": [
"bin",
"docs",
"src"
],
"license": "MIT",
"main": "index.js",
"bugs": {
Expand Down Expand Up @@ -36,10 +41,10 @@
"eslint": "^8.24.0"
},
"scripts": {
"lint": "eslint --ext .js,.mjs src pcsync.js pcwatch.js"
"lint": "eslint --ext .js,.mjs src bin"
},
"bin": {
"pcsync": "./pcsync.js",
"pcwatch": "./pcwatch.js"
"pcsync": "./bin/pcsync.js",
"pcwatch": "./bin/pcwatch.js"
}
}

0 comments on commit 4647e09

Please sign in to comment.