Skip to content

Commit 0aac28b

Browse files
committed
fix: Create release
1 parent 39de3d9 commit 0aac28b

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

.github/workflows/cd.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,22 @@ jobs:
1717
node-version: '14.x'
1818
registry-url: 'https://registry.npmjs.org'
1919

20-
- run: yarn
21-
- run: yarn test
22-
- run: yarn build
23-
- run: yarn publish --access public
24-
env:
25-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
26-
name: Deploy
20+
- name: Download dependencies
21+
run: yarn
2722

28-
- name: Create tag name
29-
run: |
30-
export PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')
23+
- name: Run the tests inside project
24+
run: yarn test
3125

32-
- run: echo ${{ env.PACKAGE_VERSION }}
26+
- name: Transpile typescript to javascript
27+
run: yarn build
3328

34-
- run: echo $PACKAGE_VERSION
29+
- name: Automatic GitHub Release
30+
uses: justincy/github-action-npm-release@2.0.1
31+
id: release
3532

36-
- name: Create Release
37-
id: create_release
38-
uses: actions/create-release@v1
33+
- name: Publish to NPM Registry
34+
run: yarn publish --access public
35+
if: steps.release.outputs.released == 'true'
3936
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # provided by actions
41-
with:
42-
tag_name: ${{ env.PACKAGE_VERSION }}
43-
release_name: Release ${{ env.PACKAGE_VERSION }}
44-
body: |
45-
Changes in this Release
46-
- (See here)[https://github.com/SecJS/Utils/blob/master/README.md]
47-
draft: false
48-
prerelease: false
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
name: Deploy

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@secjs/utils",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "",
55
"scripts": {
66
"build": "tsc",

0 commit comments

Comments
 (0)