Skip to content

Commit d652a70

Browse files
author
Philipp Karlsson
committed
publishing and tagging pipeline
1 parent e2c6b9d commit d652a70

File tree

4 files changed

+30
-64
lines changed

4 files changed

+30
-64
lines changed

.github/workflows/release-package.yml

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- "main"
7+
release:
8+
type: [ created ]
79

810
jobs:
911
build:
@@ -36,44 +38,30 @@ jobs:
3638
branch: docs
3739
folder: showcase/build
3840
single-commit: true
39-
#
40-
# build-library:
41-
# needs: install-and-test
42-
# runs-on: ubuntu-latest
43-
# defaults:
44-
# run:
45-
# working-directory: 'library'
46-
# name: "Bump version and create changelog with commitizen"
47-
# steps:
48-
# - name: Check out
49-
# uses: actions/checkout@v3
50-
# with:
51-
# fetch-depth: 0
52-
# token: "${{ secrets.GITHUB_TOKEN }}"
53-
# - id: cz
54-
# name: Bump package
55-
# uses: commitizen-tools/commitizen-action@master
56-
# with:
57-
# github_token: ${{ secrets.GITHUB_TOKEN }}
58-
# - name: Print Version
59-
# run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
60-
# - name: Build library
61-
# run: npm ci build
6241

63-
# publish-gpr:
64-
# needs: tag-and-bump
65-
# runs-on: ubuntu-latest
66-
# defaults:
67-
# run:
68-
# working-directory: 'library'
69-
# steps:
70-
# - uses: actions/checkout@v3
71-
# - uses: actions/setup-node@v3
72-
# with:
73-
# node-version: '19.x'
74-
# registry-url: 'https://registry.npmjs.org'
75-
#
76-
# - name: Publish to npmjs
77-
# run: npm publish --access public
78-
# env:
79-
# NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
42+
publish:
43+
needs: build
44+
if: ${{ github.event_name == 'release' }}
45+
runs-on: ubuntu-latest
46+
defaults:
47+
run:
48+
working-directory: 'library'
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: actions/setup-node@v3
52+
with:
53+
node-version: '19.x'
54+
registry-url: 'https://registry.npmjs.org'
55+
56+
- name: Get release version
57+
id: release
58+
run: |
59+
FULL_VERSION=${{ github.event.release.tag_name }}
60+
SHORT_VERSION=${FULL_VERSION:1}
61+
echo shortVersion=${SHORT_VERSION} >> $GITHUB_OUTPUT
62+
63+
- name: Publish to npmjs
64+
working-directory: ./library
65+
run: npm publish --access public --tag ${{ steps.release.outputs.shortVersion }}
66+
env:
67+
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4+
/showcase/package-lock.json
45
*/build
56
*/dist
67
*/node_modules

showcase/.gitignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

showcase/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
work correctly both with client-side routing and a non-root public URL.
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
27-
<title>UI-Kit-TS2</title>
27+
<title>UI-Kit-TS</title>
2828
</head>
2929
<body>
3030
<noscript>You need to enable JavaScript to run this app.</noscript>

0 commit comments

Comments
 (0)