Skip to content

Commit 1bd277c

Browse files
committed
debug with version roll
1 parent 697ebd4 commit 1bd277c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,27 @@ jobs:
2121

2222
- name: Get current npm version
2323
id: current_version
24-
run: echo "version=$(node -p 'require(`./package.json`).version')" >> $GITHUB_ENV
24+
run: |
25+
CURRENT_VERSION=$(node -p 'require(`./package.json`).version')
26+
echo "current_version=${CURRENT_VERSION}" >> $GITHUB_ENV
27+
echo "Current npm version: ${CURRENT_VERSION}"
2528
2629
- name: Get previous npm version
2730
id: previous_version
2831
run: |
29-
PREV_VERSION=$(npm view ${{ github.repository }} version)
32+
PREV_VERSION=$(npm show $(node -p 'require(`./package.json`).name') version)
3033
echo "prev_version=${PREV_VERSION}" >> $GITHUB_ENV
34+
echo "Previous npm version: ${PREV_VERSION}"
3135
3236
- name: Check version change
3337
id: version_check
3438
run: |
35-
if [ "${{ env.version }}" != "${{ env.prev_version }}" ]; then
39+
if [ "${{ env.current_version }}" != "${{ env.prev_version }}" ]; then
3640
echo "changed=true" >> $GITHUB_ENV
3741
else
3842
echo "changed=false" >> $GITHUB_ENV
3943
fi
44+
echo "Version changed: ${{ env.changed }}"
4045
4146
- name: Publish to npm
4247
if: env.changed == 'true'
@@ -48,9 +53,9 @@ jobs:
4853
if: env.changed == 'true'
4954
uses: actions/create-release@v1
5055
with:
51-
tag_name: v${{ env.version }}
52-
release_name: Release v${{ env.version }}
53-
body: New release v${{ env.version }}
56+
tag_name: v${{ env.current_version }}
57+
release_name: Release v${{ env.current_version }}
58+
body: New release v${{ env.current_version }}
5459
draft: false
5560
prerelease: false
5661
env:

0 commit comments

Comments
 (0)