diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99c056c..e88d853 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,10 +26,6 @@ jobs: with: node-version: 20 - run: yarn install - - id: install-semver-tool - run: | - wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver - chmod +x /usr/local/bin/semver - run: yarn zx ./release.mjs -v $VERSION_TO_BUMP env: VERSION_TO_BUMP: ${{ inputs.versionToBump }} diff --git a/package.json b/package.json index ab18e8f..a926feb 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "jest-environment-jsdom": "29.7.0", "react": "18.3.1", "react-dom": "18.3.1", + "semver": "7.6.2", "ts-jest": "29.1.5", "tsup": "8.1.0", "typescript": "5.5.3", diff --git a/release.mjs b/release.mjs index 4eaefc7..952f0ee 100755 --- a/release.mjs +++ b/release.mjs @@ -1,5 +1,3 @@ -#!/usr/bin/env zx - /* * Script to release the seats.io java lib. * - changes the version number in README.md @@ -10,11 +8,12 @@ * Prerequisites: * - zx installed (https://github.com/google/zx) * - gh cli installed (https://cli.github.com/) -* - semver cli installed (https://github.com/fsaintjacques/semver-tool) * * Usage: -* zx ./release.mjs -v major/minor -n "release notes" -* */ +* yarn zx ./release.mjs -v major/minor -n "release notes" +* +*/ +const semver = require('semver') // don't output the commands themselves $.verbose = false @@ -49,7 +48,7 @@ async function fetchLatestReleasedVersionNumber() { } async function determineNextVersionNumber(previous) { - return (await $`semver bump ${versionToBump} ${previous}`).stdout.trim() + return semver.inc(previous, versionToBump) } async function bumpVersionInFiles() {