-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (49 loc) · 1.79 KB
/
http-client.yml
File metadata and controls
57 lines (49 loc) · 1.79 KB
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
56
57
name: npm-publish-http-client
on:
push:
branches:
- http/client/0.0
- http/client/0.1
jobs:
npm-publish:
name: npm-publish-http-client
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check version changes
uses: EndBug/version-check@v1
id: check
with:
file-name: ./lib/http/client/package.json
- name: Version update detected
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Setup node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v5
with:
node-version: 20.x
always-auth: true
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
if: steps.check.outputs.changed == 'true'
run: npm ci --workspace @kelchy/http-client --include-dev
- name: Test
if: steps.check.outputs.changed == 'true'
run: npm run --workspace @kelchy/http-client test:unit
- name: Publish
if: steps.check.outputs.changed == 'true'
run: npm publish --workspace @kelchy/http-client --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create a GitHub release
if: steps.check.outputs.changed == 'true'
uses: actions/create-release@v1
with:
tag_name: http/client/v${{ steps.check.outputs.version }}
release_name: Release http/client/v${{ steps.check.outputs.version }}
body: 'Release: http/client/v${{ steps.check.outputs.version }}\nType: ${{ steps.check.outputs.type }}\nCommit: ${{ steps.check.outputs.commit }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}