Skip to content

Commit

Permalink
refactor: change version handling
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Wendel <[email protected]>
  • Loading branch information
KwadFan committed May 24, 2024
1 parent bb12882 commit 7a031ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions config/default
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"

Expand Down
1 change: 0 additions & 1 deletion src/version

This file was deleted.

0 comments on commit 7a031ed

Please sign in to comment.