Skip to content

Commit 89dd5bf

Browse files
authored
Changed order to fix the publish pipeline (#7)
1 parent 884a8e0 commit 89dd5bf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,21 @@ jobs:
6868
new_version="${major}.${minor}.${patch}"
6969
echo "New release is ${new_version}"
7070
echo "new_version=${new_version}" >> "$GITHUB_OUTPUT"
71-
git pull --rebase
7271
npm version --no-git-tag-version --allow-same-version $new_version || exit 0
7372
73+
- name: Publish the package
74+
env:
75+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76+
run: npm publish --access public
77+
7478
- name: Commit the changes
75-
continue-on-error: true
76-
run: |
79+
env:
80+
new_version: ${{ steps.set_new_version.outputs.new_version }}
81+
run: |
82+
git reset --hard
7783
git config --global user.email 'github-ci@boldcommerce.com'
7884
git config --global user.name 'bold-github-ci'
85+
npm version --no-git-tag-version --allow-same-version $new_version || exit 0
7986
git add package.json package-lock.json
8087
git commit -m 'Bump version number for release' || exit 0
8188
git push origin || exit 0
@@ -84,8 +91,4 @@ jobs:
8491
env:
8592
new_version: ${{ steps.set_new_version.outputs.new_version }}
8693
run: |
87-
gh release create ${new_version} --generate-notes --latest
88-
89-
- run: npm publish --access public
90-
env:
91-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
94+
gh release create ${new_version} --generate-notes --latest

0 commit comments

Comments
 (0)