Skip to content

Commit

Permalink
ci: run prepublish scripts (#5)
Browse files Browse the repository at this point in the history
* ci: run prepublish scripts

* ci: use different method for brunch detection
  • Loading branch information
Wroud authored Sep 7, 2024
1 parent af6ba42 commit bb2b471
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: sanitize_branch
run: |
# Replace invalid characters with a dash '-'
SANITIZED_BRANCH=$(echo "${{ github.head_ref }}" | sed 's/[\/\\:*?"<>|]/-/g')
SANITIZED_BRANCH=$(echo "${{ github.event.workflow_run.head_branch }}" | sed 's/[\/\\:*?"<>|]/-/g')
echo "SANITIZED_BRANCH=$SANITIZED_BRANCH" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ jobs:
- name: Run tests
run: yarn test

- name: Run prepublish
run: yarn workspaces foreach -A --no-private run prepublish

- name: Publish to npm
run: yarn workspaces foreach -A --no-private npm publish --access public --tolerate-republish
2 changes: 1 addition & 1 deletion packages/di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"ci:version": "yarn version $(yarn conventional-recommended-bump -p conventionalcommits -t di-v --commit-path .)",
"ci:changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -t di-v --commit-path .",
"ci:tag": "VERSION=$(grep '\"version\"' package.json | awk -F '\"' '{print $4}') && git add package.json CHANGELOG.md && git commit -m \"Release v$VERSION\" && git tag -a \"di-v$VERSION\" -m \"Release version $VERSION\" && git push",
"prepublish": "yarn run ci:version && yarn run ci:changelog && yarn run ci:tag",
"prepublish": "yarn run ci:version || exit 0 && yarn run ci:changelog && yarn run ci:tag",
"test": "tests-runner",
"test:ci": "CI=true yarn run test",
"build": "tsc -b",
Expand Down

0 comments on commit bb2b471

Please sign in to comment.