@@ -21,50 +21,86 @@ jobs:
2121 # cloned to etherpad-lite then moved to ../etherpad-lite. To avoid
2222 # conflicts with this plugin's clone, etherpad-lite must be cloned and
2323 # moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE.
24- - uses : actions/checkout@v2
24+ -
25+ uses : actions/checkout@v3
2526 with :
2627 repository : ether/etherpad-lite
2728 path : etherpad-lite
28- - run : mv etherpad-lite ..
29+ -
30+ run : mv etherpad-lite ..
2931 # etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
3032 # safe to clone this plugin's repo to $GITHUB_WORKSPACE.
31- - uses : actions/checkout@v2
32- - uses : actions/setup-node@v1
33+ -
34+ uses : actions/checkout@v3
35+ # This is necessary for actions/setup-node because '..' can't be used in
36+ # cache-dependency-path.
37+ -
38+ name : Create ep_etherpad-lite symlink
39+ run : |
40+ mkdir -p node_modules
41+ ln -s ../../etherpad-lite/src node_modules/ep_etherpad-lite
42+ -
43+ uses : actions/setup-node@v3
3344 with :
3445 node-version : 12
46+ cache : ' npm'
47+ cache-dependency-path : |
48+ node_modules/ep_etherpad-lite/package-lock.json
49+ node_modules/ep_etherpad-lite/bin/doc/package-lock.json
50+ package-lock.json
3551 # All of ep_etherpad-lite's devDependencies are installed because the
3652 # plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`.
3753 # Eventually it would be nice to create an ESLint plugin that prohibits
3854 # Etherpad plugins from piggybacking off of ep_etherpad-lite's
3955 # devDependencies. If we had that, we could change this line to only
4056 # install production dependencies.
41- - run : cd ../etherpad-lite/src && npm ci
42- - run : npm ci
57+ -
58+ run : cd ../etherpad-lite/src && npm ci
59+ -
60+ run : npm ci
4361 # This runs some sanity checks and creates a symlink at
4462 # node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src.
4563 # This step must be done after `npm ci` installs the plugin's dependencies
4664 # because npm "helpfully" cleans up such symlinks. :( Installing
4765 # ep_etherpad-lite in the plugin's node_modules prevents lint errors and
4866 # unit test failures if the plugin does `require('ep_etherpad-lite/foo')`.
49- - run : npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src
50- - run : npm test
51- - run : npm run lint
67+ -
68+ run : npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src
69+ -
70+ run : npm test
71+ -
72+ run : npm run lint
5273
5374 publish-npm :
5475 if : github.event_name == 'push'
5576 needs : test
5677 runs-on : ubuntu-latest
5778 steps :
58- - uses : actions/checkout@v2
59- - uses : actions/setup-node@v1
79+ -
80+ uses : actions/checkout@v3
81+ with :
82+ fetch-depth : 0
83+ -
84+ uses : actions/setup-node@v3
6085 with :
6186 node-version : 12
6287 registry-url : https://registry.npmjs.org/
63- - run : git config user.name 'github-actions[bot]'
64- - run : git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
65- - run : npm ci
66- - run : npm version patch
67- - run : git push --follow-tags
88+ cache : ' npm'
89+ -
90+ name : Bump version (patch)
91+ run : |
92+ LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
93+ NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
94+ [ "${NEW_COMMITS}" -gt 0 ] || exit 0
95+ git config user.name 'github-actions[bot]'
96+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
97+ npm ci
98+ npm version patch
99+ git push --follow-tags
100+ # This is required if the package has a prepare script that uses something
101+ # in dependencies or devDependencies.
102+ -
103+ run : npm ci
68104 # `npm publish` must come after `git push` otherwise there is a race
69105 # condition: If two PRs are merged back-to-back then master/main will be
70106 # updated with the commits from the second PR before the first PR's
@@ -75,9 +111,12 @@ jobs:
75111 # already-used version number. By running `npm publish` after `git push`,
76112 # back-to-back merges will cause the first merge's workflow to fail but
77113 # the second's will succeed.
78- - run : npm publish
114+ -
115+ run : npm publish
116+ env :
117+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
118+ -
119+ name : Add package to etherpad organization
120+ run : npm access grant read-write etherpad:developers
79121 env :
80122 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
81-
82- # #ETHERPAD_NPM_V=2
83- # # NPM configuration automatically created using bin/plugins/updateAllPluginsScript.sh
0 commit comments