Skip to content

Commit b8d0dbe

Browse files
committed
Simple tag
1 parent ef72655 commit b8d0dbe

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

.github/workflows/npm.yml

+19-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ on:
33
push:
44
branches:
55
- main
6-
tags: v*
6+
tags:
7+
- "v*"
78

89
jobs:
910
build:
@@ -18,6 +19,8 @@ jobs:
1819
steps:
1920
- name: Checkout
2021
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
2124
- name: APT Install
2225
run: |
2326
sudo apt-get install \
@@ -35,20 +38,22 @@ jobs:
3538
- name: NPM Install
3639
run: npm ci
3740
- name: Build and Test
38-
run: npm run build-and-test
39-
- name: Release
40-
if: github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v')
41-
run: npm run release
42-
- name: GitHub Release
43-
if: github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v')
44-
uses: ncipollo/release-action@v1
45-
with:
46-
artifacts: dist/layer.zip
47-
token: ${{ secrets.GITHUB_TOKEN }}
41+
run: npm run build && npm run package
42+
# - name: Release
43+
# if: startsWith(github.ref, 'refs/tags/v')
44+
# run: npm run release
45+
# - name: GitHub Release
46+
# if: startsWith(github.ref, 'refs/tags/v')
47+
# uses: ncipollo/release-action@v1
48+
# with:
49+
# artifacts: dist/layer.zip
50+
# token: ${{ secrets.GITHUB_TOKEN }}
4851
- name: NPM Publish
49-
if: github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v')
52+
if: startsWith(github.ref, 'refs/tags/v')
5053
env:
5154
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5255
run: |
53-
npm version from-git
54-
npm publish --registry=https://registry.npmjs.org
56+
echo "$(git describe --tags --abbrev=0)"
57+
npm --no-git-tag-version version "$(git describe --tags --abbrev=0)"
58+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
59+
npm publish

0 commit comments

Comments
 (0)