Skip to content

Commit d318014

Browse files
Add CI/CD
Signed-off-by: Phillip Kruger <phillip.kruger@gmail.com>
1 parent d1222ec commit d318014

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to npm on Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '16'
18+
registry-url: 'https://registry.npmjs.org/'
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Update version in package.json
24+
run: |
25+
RELEASE_VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')
26+
npm version $RELEASE_VERSION --no-git-tag-version
27+
28+
- name: Publish to npm
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qomponent/qui-code-block",
3-
"version": "1.0.17-SNAPSHOT",
3+
"version": "999-SNAPSHOT",
44
"description": "A Code block UI component",
55
"publishConfig": {
66
"access": "public"

0 commit comments

Comments
 (0)