diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh new file mode 100644 index 0000000..e11f307 --- /dev/null +++ b/.github/scripts/release.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +NEXT_VERSION=$1 +CURRENT_VERSION=$(cat composer.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') + +sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEXT_VERSION\"/g" composer.json + +zip -r "/tmp/release.zip" composer.json README.md CHANGELOG.md src diff --git a/.releaserc b/.releaserc index 951ce0a..295bc2c 100644 --- a/.releaserc +++ b/.releaserc @@ -15,18 +15,30 @@ [ "@semantic-release/exec", { - "prepareCmd": "sed -i 's/0.0.0/${nextRelease.version}/g' composer.json" + "prepareCmd": "sh ./.github/scripts/release.sh ${nextRelease.version}" } ], [ "@semantic-release/git", { "assets": [ - "CHANGELOG.md" + "CHANGELOG.md", + "composer.json" ], "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" } ], - "@semantic-release/github" + [ + "@semantic-release/github", + { + "assets": [ + { + "path": "/tmp/release.zip", + "name": "transliterator-${nextRelease.version}", + "label": "Transliterator v${nextRelease.version}" + } + ] + } + ] ] } diff --git a/composer.json b/composer.json index 245d1e7..c31eede 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "oblak/transliterator", "description": "This Module Transliterates Cyrillic to Latin script", - "version": "0.0.0", + "version": "2.0.0", "authors": [ { "name": "Sibin Grasic", diff --git a/composer.lock b/composer.lock index 7292505..dde1779 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5685f1eab847a63896234c0db83f39bf", + "content-hash": "b176e11aa4a77464e508bf259532a368", "packages": [], "packages-dev": [ {