From 7a031ed2ba1c31a36240b082f48e88719816f07d Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Fri, 24 May 2024 19:02:59 +0200 Subject: [PATCH] refactor: change version handling Signed-off-by: Stephan Wendel --- .github/workflows/Release.yml | 8 ++++---- config/default | 15 +-------------- src/version | 1 - 3 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 src/version diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 11858657e..3a2f96c6e 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -23,20 +23,20 @@ jobs: id: current-version shell: bash run: | - version=$(cat ./src/version) - echo "version=${version}" >> $GITHUB_OUTPUT + source ./config/default + echo "version=${DIST_VERSION}" >> $GITHUB_OUTPUT - name: Push version number if: steps.current-version.outputs.version != github.event.inputs.version shell: bash run: | - echo ${{ github.event.inputs.version }} > ./src/version + sed -i "s|DIST_VERSION.*|DIST_VERSION=\"${{ github.event.inputs.version }}\"|" ./config/default - name: git add & commit & push if: steps.current-version.outputs.version != github.event.inputs.version uses: EndBug/add-and-commit@v9 with: - add: "./src/version" + add: "./config/default" default_author: github_actions message: "chore: push version number to v${{ github.event.inputs.version }}" push: true diff --git a/config/default b/config/default index 780a3d40c..4b619ac76 100644 --- a/config/default +++ b/config/default @@ -2,19 +2,6 @@ # Shebang for better file detection # shellcheck enable=require-variable-braces -get_version() { - local ver - ver="$(realpath "$( dirname -- "${BASH_SOURCE[0]}")"/../src/version)" - - if [ -f "${ver}" ]; then - cat "${ver}" - return - fi - - ver="$(realpath "$( dirname -- "${BASH_SOURCE[0]}")"/version)" - cat "${ver}" -} - get_img_name() { local -a types types=(zip 7z xz) @@ -29,7 +16,7 @@ get_img_name() { fi } -DIST_VERSION="$(get_version)" +DIST_VERSION="1.3.2" BASE_ZIP_IMG="$(get_img_name)" DIST_NAME="MainsailOS" diff --git a/src/version b/src/version deleted file mode 100644 index 1892b9267..000000000 --- a/src/version +++ /dev/null @@ -1 +0,0 @@ -1.3.2