diff --git a/.releaserc.json b/.releaserc.json index 3412efd..21b9632 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -33,19 +33,7 @@ [ "@semantic-release/exec", { - "prepareCmd": "sha256sum build/vault/plugins/vault-plugin-secrets-nats > build/vault/plugins/vault-plugin-secrets-nats.sha256" - } - ], - [ - "@semantic-release/exec", - { - "prepareCmd": "sed -i \"s#image: ghcr.io/edgefarm/vault-plugin-secrets-nats/vault-with-nats-secrets:.*#image: ghcr.io/edgefarm/vault-plugin-secrets-nats/vault-with-nats-secrets:${nextRelease.version}#g\" README.md" - } - ], - [ - "@semantic-release/exec", - { - "prepareCmd": "export SHA256SUM=$(cat build/vault/plugins/vault-plugin-secrets-nats.sha256) && sed -i \"s#sha256: .*#sha256: ${SHA256SUM}#g\" README.md" + "prepareCmd": "sh ./ci/semantic-release-patch-readme.sh ${nextRelease.version}" } ], [ diff --git a/ci/semantic-release-patch-readme.sh b/ci/semantic-release-patch-readme.sh new file mode 100755 index 0000000..44554ec --- /dev/null +++ b/ci/semantic-release-patch-readme.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +NEXTVERSION=$1 +sha256sum build/vault/plugins/vault-plugin-secrets-nats > build/vault/plugins/vault-plugin-secrets-nats.sha256 +export SHA256SUM=$(cat build/vault/plugins/vault-plugin-secrets-nats.sha256 | cut -d ' ' -f1) +sed -i "s#sha256: .*#sha256: ${SHA256SUM}#g" README.md +sed -i "s#image: ghcr.io/edgefarm/vault-plugin-secrets-nats/vault-with-nats-secrets:.*#image: ghcr.io/edgefarm/vault-plugin-secrets-nats/vault-with-nats-secrets:${NEXTVERSION}#g" README.md