-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.52 KB
/
publish.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
56
57
58
59
60
61
name: Publish Configurations on Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install
- uses: actions/cache@v3
name: Setup npm cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Tag Name
id: set_tag
run: |
echo ::set-output name=tag::$(git describe HEAD --abbrev=0)
echo "Tag: ${{ steps.set_tag.outputs.tag }}"
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ steps.tag.outputs.tag }}
tag_name: ${{ steps.tag.outputs.tag }}
body_path: CHANGELOG.md
draft: false
prerelease: false
- name: Login to npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish Configuration to NPM
run: npm publish --verbose --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}