From 9c15c866ad8a540e32a41345f100a4d1a69b5f9d Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 11 Jul 2024 20:22:51 -0400 Subject: [PATCH] fix: add option to print esi-shell version (#100) --- .github/workflows/release.yml | 7 +++++++ .releaserc.yaml | 7 +++++++ esi-shell | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6ccc60..4c905c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,13 @@ jobs: with: fetch-depth: 0 # Important for Semantic Release to analyze all commits + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + + - run: npm install semantic-release-replace-plugin -D + - name: Copy external assets run: cp /home/runner/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh . diff --git a/.releaserc.yaml b/.releaserc.yaml index fc61919..f714790 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -9,6 +9,12 @@ branches: tagFormat: '${version}' # without this, the tag is prefixed with a 'v' plugins: - "@semantic-release/commit-analyzer" + - path: "semantic-release-replace-plugin" + replacements: + - files: + - esi-shell + from: ESI_SHELL_VERSION=.* + to: ESI_SHELL_VERSION=${nextRelease.version} - "@semantic-release/release-notes-generator" - "@semantic-release/changelog" - path: "@semantic-release/npm" @@ -17,4 +23,5 @@ plugins: assets: - "CHANGELOG.md" - "package.json" + - "esi-shell" message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}" diff --git a/esi-shell b/esi-shell index 9906bbb..80553f4 100755 --- a/esi-shell +++ b/esi-shell @@ -41,6 +41,7 @@ usage() { echo "OPTIONS:" echo " -h, --help Print this message" echo " -t, --tag Specific esi-shell tag to use (Default: $IMAGE_TAG)" + echo " --version Print esi-shell version" echo "" echo "COMMAND is a command to execute in the container, leave it empty for interactive shell. For example:" echo " pwd" @@ -110,6 +111,10 @@ do -h | --help) usage 0 ;; + --version) + echo "${ESI_SHELL_VERSION-}" + exit 0 + ;; --) shift CONTAINER_OPTIONS="$@"