Skip to content

Commit

Permalink
fix: embed correct version into builds
Browse files Browse the repository at this point in the history
- adds NEXT_VERSION env variable to the rollup
- builds the package as part of semantic-release so that it can utilize the new version in the build
- commit to git after npm so that git contains the updated package.json file

fixes #216
  • Loading branch information
6utt3rfly committed Mar 22, 2022
1 parent f26b244 commit 9e90f3d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
version: 6.0.2
run_install: true
- run: pnpm install
- run: pnpm install --ignore-scripts
- run: pnpm run default
- run: pnpm run release
env:
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/6utt3rfly/jsep"
"url": "https://github.com/EricSmekens/jsep.git"
},
"type": "module",
"main": "./dist/cjs/jsep.cjs.js",
Expand Down Expand Up @@ -117,10 +117,15 @@
[
"@semantic-release/npm",
{
"npmPublish": false,
"tarballDir": "./"
}
],
[
"@semantic-release/git",
{
"prepareCmd": "NEXT_VERSION=${nextRelease.version} pnpm run build"
}
],
[
"@semantic-release/git",
{
Expand Down
4 changes: 0 additions & 4 deletions packages/arrow/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
const ARROW_EXP = 'ArrowFunctionExpression';

// test arrow change

export default {
name: 'arrow',

version: '<%= version %>',

init(jsep) {
// arrow-function expressions: () => x, v => v, (a, b) => v
jsep.addBinaryOp('=>', 0.1, true);
Expand Down
2 changes: 0 additions & 2 deletions packages/ternary/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const CONDITIONAL_EXP = 'ConditionalExpression';

// test change

export default {
name: 'ternary',

Expand Down
4 changes: 2 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# (or npm run release -- --debug --no-cli --dry-run)

echo "Semantic-Release JSEP"
pnpx semantic-release "$@" --no-ci
pnpx semantic-release "$@"

packages=($(ls -d packages/*))
for package in "${packages[@]}"; do
printf "\n\nSemantic-Release $package\n"
(cd $package && pwd && pnpx semantic-release --no-ci -e semantic-release-monorepo "$@")
(cd $package && pwd && pnpx semantic-release -e semantic-release-monorepo "$@")
done

0 comments on commit 9e90f3d

Please sign in to comment.