forked from tadas-s/isbnjs
-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (52 loc) · 1.73 KB
/
auto_update_groups_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Auto-update groups data
on:
schedule:
# Every first of the month at 10:00
- cron: '0 10 1 * *'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci --no-audit
- run: npm test
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci --no-audit
- run: npm run update-groups
# See https://github.com/marketplace/actions/add-commit
- uses: EndBug/add-and-commit@v9
with:
author_name: Auto-update groups
author_email: [email protected]
message: 'Auto-update groups'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
echo 'Set git config user.email...'
git config --global user.email "[email protected]"
echo 'Set git config user.name...'
git config --global user.name "Auto-Update groups"
echo 'Increment patch version number...'
npm version patch
echo 'Pushing commits to repo...'
git push origin main
echo 'Pushing tags to repo...'
git push origin main --tags
echo 'Setup .npmrc...'
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
echo 'Publish on NPM...'
npm publish
echo 'Done!'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings