diff --git a/.github/workflows/tag-prerelease.yml b/.github/workflows/tag-prerelease.yml index 83660e409d..f6446c55f5 100644 --- a/.github/workflows/tag-prerelease.yml +++ b/.github/workflows/tag-prerelease.yml @@ -32,10 +32,11 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - run: yarn + - run: cd scripts && yarn - name: Tag prerelease run: | + cd scripts # setup the username and email. git config --global user.name "Budibase Staging Release Bot" git config --global user.email "<>" - ./scripts/versionCommit.sh prerelease + ./versionCommit.sh prerelease diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index f361c200a0..191c3ad9ef 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -42,12 +42,13 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - run: yarn + - run: cd scripts && yarn - name: Tag release run: | + cd scripts # setup the username and email. git config --global user.name "Budibase Staging Release Bot" git config --global user.email "<>" BUMP_TYPE_INPUT=${{ github.event.inputs.versioning }} BUMP_TYPE=${BUMP_TYPE_INPUT:-"patch"} - ./scripts/versionCommit.sh $BUMP_TYPE + ./versionCommit.sh $BUMP_TYPE diff --git a/package.json b/package.json index b521030caf..8b715d8747 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "prettier-plugin-svelte": "^2.3.0", "rimraf": "^3.0.2", "rollup-plugin-replace": "^2.2.0", - "semver": "^7.5.0", "svelte": "^3.38.2", "typescript": "4.7.3" }, diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000000..40b878db5b --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/scripts/bumpVersion.js b/scripts/bumpVersion.js index 19deb684da..dd54074ae8 100644 --- a/scripts/bumpVersion.js +++ b/scripts/bumpVersion.js @@ -1,7 +1,7 @@ const fs = require("fs") const semver = require("semver") -const filePath = "lerna.json" +const filePath = "../lerna.json" const versionBump = process.argv[2] || "patch" // Read and parse lerna.json file diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000000..c08bc5b7c2 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,10 @@ +{ + "name": "scripts", + "private": true, + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "devDependencies": { + "semver": "^7.5.3" + } +} diff --git a/scripts/versionCommit.sh b/scripts/versionCommit.sh index d70f6900e2..69137a988f 100755 --- a/scripts/versionCommit.sh +++ b/scripts/versionCommit.sh @@ -7,10 +7,10 @@ then fi # Bump the version in lerna.json -node scripts/bumpVersion.js $1 +node ./bumpVersion.js $1 -NEW_VERSION=$(node -p "require('./lerna.json').version") +NEW_VERSION=$(node -p "require('../lerna.json').version") git add lerna.json git commit -m "Bump version to $NEW_VERSION" git tag v$NEW_VERSION diff --git a/scripts/yarn.lock b/scripts/yarn.lock new file mode 100644 index 0000000000..fe88e5d4ba --- /dev/null +++ b/scripts/yarn.lock @@ -0,0 +1,22 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +semver@^7.5.3: + version "7.5.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/yarn.lock b/yarn.lock index c572cdc1b8..4c02b28ac2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22426,13 +22426,6 @@ semver@^7.2.1, semver@^7.3.5: dependencies: lru-cache "^6.0.0" -semver@^7.5.0: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== - dependencies: - lru-cache "^6.0.0" - semver@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52"