Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ jobs:
if: github.event_name == 'workflow_dispatch'
run: |
export FULL_VERSION=${{ inputs.version }}
export VERSION_WITHOUT_PATCH_PART=$(echo "$FULL_VERSION" | grep -Po '(\d+\.\d+)')
export VERSION_WITHOUT_PATCH_PART=$(echo "$FULL_VERSION" | grep -Po '(\d+\.\d+)' | head -n1)
echo "UVMS_GIT_TAG=$(./getNextVersion.sh uvms $FULL_VERSION)" >> $GITHUB_ENV
echo "UVMS_FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV
echo "UVMS_VERSION_AND_ALIASES=$VERSION_WITHOUT_PATCH_PART latest dev" >> $GITHUB_ENV

Expand Down Expand Up @@ -84,14 +85,19 @@ jobs:
run: |
mike deploy -u ${{ env.UVMS_VERSION_AND_ALIASES }}

- name: Tag release
id: tag-release
if: github.event_name == 'workflow_dispatch'
env:
TAG: ${{ env.UVMS_GIT_TAG }}
run: |
git tag -f -a "${TAG}" -m "docs: release ${TAG} of documentation"
git push origin ${VERSION}

- name: Publish documentation
id: publish-documentation
if: github.event_name != 'pull_request'
env:
VERSION: ${{ env.UVMS_FULL_VERSION }}
run: |
git tag -f -a "${VERSION}" -m "docs: release ${VERSION} of documentation"
git push origin ${VERSION}
git push origin HEAD
git checkout gh-pages
git push origin HEAD
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Get next Docker image version
id: get-next-version
run: |
echo "UVMS_IMAGE_VERSION=$(./getNextDockerImageVersion.sh)" >> $GITHUB_ENV
echo "UVMS_IMAGE_VERSION=$(./getNextVersion.sh docker)" >> $GITHUB_ENV

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
Expand Down
25 changes: 0 additions & 25 deletions getNextDockerImageVersion.sh

This file was deleted.

29 changes: 29 additions & 0 deletions getNextVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env sh

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

bump_version () {
doc_version_part=$(echo "$latest_tag" | cut -d "." -f 4)
doc_version_part="${doc_version_part:-0}"
bumped_version=$((doc_version_part+1))
print_version "$bumped_version"
}

print_version () {
echo -n "$input_version.${1:-1}"
}

if [ "$1" = "docker" ]; then
input_version=$(grep -m 1 -o ':.*' $SCRIPTPATH/Dockerfile | tr -d ':')
latest_tag=$(git tag -l --sort=-taggerdate 'docker-image-*' | head -n1 | sed 's/docker-image-//' 2>&1)
else
input_version="$2"
latest_tag=$(git tag -l --sort=-taggerdate | grep -v 'docker' | head -n1 2>&1)
fi

case $latest_tag in
("$input_version"*) bump_version;;
(*) print_version;;
esac

Loading