11
11
- ' LICENSE'
12
12
- ' package.json'
13
13
- ' readme.md'
14
- - ' test/**' # TODO: delete!
15
14
16
15
jobs :
17
- # lint:
18
- # name: Lint
19
- # if: |
20
- # !startsWith(github.event.head_commit.message, 'Release version ')
21
- # runs-on: ubuntu-latest
22
- # steps:
23
- # - name: Check out repository
24
- # uses: actions/checkout@v3
25
- # - name: Install Node.js
26
- # uses: actions/setup-node@v3
27
- # with:
28
- # node-version: 16.x
29
- # # cache: 'npm'
30
- # - run: npm install
31
- # - run: npm run lint
16
+ lint :
17
+ name : Lint
18
+ if : |
19
+ !startsWith(github.event.head_commit.message, 'Release version ')
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Check out repository
23
+ uses : actions/checkout@v3
24
+ - name : Install Node.js
25
+ uses : actions/setup-node@v3
26
+ with :
27
+ node-version : 16.x
28
+ # cache: 'npm'
29
+ - run : npm install
30
+ - run : npm run lint
32
31
33
32
test :
34
33
name : Test (Node.js ${{ matrix.node-version }} on ${{ matrix.os }})
35
- # needs: lint
34
+ needs : lint
36
35
strategy :
37
36
fail-fast : false
38
37
matrix :
@@ -57,61 +56,60 @@ jobs:
57
56
node-version : ${{ matrix.node-version }}
58
57
# cache: 'npm'
59
58
- run : npm install
60
- # - run: npm test
61
- - run : npm run wintest
59
+ - run : npm test
62
60
63
- # version_publish_release:
64
- # name: Version / Publish / Release
65
- # needs: test
66
- # if: |
67
- # !contains(github.event.head_commit.message, '[!VERSION]')
68
- # runs-on: ubuntu-latest
69
- # steps:
70
- # - name: Check out repository
71
- # uses: actions/checkout@v3
72
- # with:
73
- # token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
61
+ version_publish_release :
62
+ name : Version / Publish / Release
63
+ needs : test
64
+ if : |
65
+ !contains(github.event.head_commit.message, '[!VERSION]')
66
+ runs-on : ubuntu-latest
67
+ steps :
68
+ - name : Check out repository
69
+ uses : actions/checkout@v3
70
+ with :
71
+ token : ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
74
72
75
- # - name: Install Node.js
76
- # uses: actions/setup-node@v3
77
- # with:
78
- # node-version: 16.x
79
- # registry-url: https://registry.npmjs.org/
73
+ - name : Install Node.js
74
+ uses : actions/setup-node@v3
75
+ with :
76
+ node-version : 16.x
77
+ registry-url : https://registry.npmjs.org/
80
78
81
- # # - run: git config --global user.name 'github-actions'
82
- # # - run: git config --global user.email 'github-actions@github.com'
83
- # - run: git config --global user.name 'vHeemstra'
84
- # - run: git config --global user.email '17368112+vHeemstra@users.noreply.github.com'
79
+ # - run: git config --global user.name 'github-actions'
80
+ # - run: git config --global user.email 'github-actions@github.com'
81
+ - run : git config --global user.name 'vHeemstra'
82
+ - run : git config --global user.email '17368112+vHeemstra@users.noreply.github.com'
85
83
86
- # # TODO? check all commits since last (= current) version instead of only the head_commit
84
+ # TODO? check all commits since last (= current) version instead of only the head_commit
87
85
88
- # - name: Major version
89
- # if: |
90
- # startsWith(github.event.head_commit.message, 'breaking') ||
91
- # startsWith(github.event.head_commit.message, 'major:')
92
- # run: echo "NEW_VERSION=$(npm version major -m 'Release version %s')" >> $GITHUB_ENV
93
- # - name: Minor version
94
- # if: |
95
- # startsWith(github.event.head_commit.message, 'feat') ||
96
- # startsWith(github.event.head_commit.message, 'minor:')
97
- # run: echo "NEW_VERSION=$(npm version minor -m 'Release version %s')" >> $GITHUB_ENV
98
- # - name: Patch version
99
- # if: |
100
- # !startsWith(github.event.head_commit.message, 'breaking') &&
101
- # !startsWith(github.event.head_commit.message, 'major:') &&
102
- # !startsWith(github.event.head_commit.message, 'feat') &&
103
- # !startsWith(github.event.head_commit.message, 'minor:')
104
- # run: echo "NEW_VERSION=$(npm version patch -m 'Release version %s')" >> $GITHUB_ENV
86
+ - name : Major version
87
+ if : |
88
+ startsWith(github.event.head_commit.message, 'breaking') ||
89
+ startsWith(github.event.head_commit.message, 'major:')
90
+ run : echo "NEW_VERSION=$(npm version major -m 'Release version %s')" >> $GITHUB_ENV
91
+ - name : Minor version
92
+ if : |
93
+ startsWith(github.event.head_commit.message, 'feat') ||
94
+ startsWith(github.event.head_commit.message, 'minor:')
95
+ run : echo "NEW_VERSION=$(npm version minor -m 'Release version %s')" >> $GITHUB_ENV
96
+ - name : Patch version
97
+ if : |
98
+ !startsWith(github.event.head_commit.message, 'breaking') &&
99
+ !startsWith(github.event.head_commit.message, 'major:') &&
100
+ !startsWith(github.event.head_commit.message, 'feat') &&
101
+ !startsWith(github.event.head_commit.message, 'minor:')
102
+ run : echo "NEW_VERSION=$(npm version patch -m 'Release version %s')" >> $GITHUB_ENV
105
103
106
- # - name: Push new version and tag
107
- # run: git push --follow-tags
104
+ - name : Push new version and tag
105
+ run : git push --follow-tags
108
106
109
- # - name: Publish to NPM
110
- # run: npm publish
111
- # env:
112
- # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107
+ - name : Publish to NPM
108
+ run : npm publish
109
+ env :
110
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
113
111
114
- # - name: Create GitHub release
115
- # run: gh release create ${{ env.NEW_VERSION }} --generate-notes
116
- # env:
117
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112
+ - name : Create GitHub release
113
+ run : gh release create ${{ env.NEW_VERSION }} --generate-notes
114
+ env :
115
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments