Skip to content

Commit

Permalink
Merge pull request #5 from selmi-karim/fix/ci
Browse files Browse the repository at this point in the history
Fix/ci
  • Loading branch information
selmi-karim authored May 30, 2020
2 parents 72e0b32 + 7d5006e commit e75b696
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release semantic-release
- name: Publish to GPR
env:
Expand All @@ -44,20 +45,3 @@ jobs:
echo "GPR should be updated"
npm publish
fi
- name: Publish to npm
run: |
# Get last commit message
readonly local last_commit_log=$(git log -1 --pretty=format:"%s")
echo "last commit log: $last_commit_log"
readonly local filter_count=$(echo "$last_commit_log" | grep -c "$COMMIT_FILTER" )
echo "number of occurence of '$COMMIT_FILTER' in '$last_commit_log': $filter_count"
if [[ "$filter_count" -eq 0 ]]; then
echo "no need to publish new version to NPM"
else
echo "NPM should be updated"
sed -i 's/npm.pkg.github.com/registry.npmjs.org/g' package.json
npm publish
fi
env:
COMMIT_FILTER: "chore(release)"
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
[
"@semantic-release/npm",
{
"npmPublish": false
"npmPublish": true
}
],
[
Expand Down

0 comments on commit e75b696

Please sign in to comment.