Skip to content

Commit

Permalink
Refactoring/versioning fix (#249)
Browse files Browse the repository at this point in the history
* Added vnext to CHANGELOG

* Updated set-version script

* Added script for pre-publish checking

* Updated docs

* Updated changelog

Co-authored-by: Duco <git@ducode.org>
  • Loading branch information
dukeofharen and Duco committed Jun 11, 2022
1 parent 34e39ee commit d7b6914
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stages:
- build-ui
- build-server
- build-docs
- pre-publish
- publish

set-version:
Expand Down Expand Up @@ -125,6 +126,14 @@ create-nuget-client-docs:
- dist
expire_in: 1 week

pre-publish-check:
image: $DEBIAN_IMAGE
stage: pre-publish
when: manual
script:
- chmod +x ./scripts/build/pre-publish-check.sh
- ./scripts/build/pre-publish-check.sh

docker-build:
image: $DOCKER_IMAGE
stage: publish
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[1.4.4]
[2022.6.11]
- Clear form helper filter if form helper is selected (https://github.com/dukeofharen/httplaceholder/pull/248).
- Changed versioning again (to a format that `dotnet tool` accepts) (https://github.com/dukeofharen/httplaceholder/pull/249).

# BREAKING CHANGES
-
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Run the following command to run a basic HttPlaceholder container: `docker run -
**Install as .NET tool**

```bash
dotnet tool install --global HttPlaceholder --version "1.*"
dotnet tool install --global HttPlaceholder
```

### Example
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Follow these steps to install / update HttPlaceholder. If you update HttPlacehol

## Dotnet global tool (cross platform)

Make sure you have installed the correct .NET SDK (at least .NET 6) for your OS (see https://dotnet.microsoft.com/download). When the .NET SDK is installed, run `dotnet tool install --global HttPlaceholder --version "1.*"` to install HttPlaceholder.
Make sure you have installed the correct .NET SDK (at least .NET 6) for your OS (see https://dotnet.microsoft.com/download). When the .NET SDK is installed, run `dotnet tool install --global HttPlaceholder` to install HttPlaceholder.

## Windows

Expand Down
11 changes: 11 additions & 0 deletions scripts/build/pre-publish-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ROOT_FOLDER="$DIR/../.."
CHANGELOG_PATH="$ROOT_FOLDER/CHANGELOG"
BASE_VERSION=$(head -n 1 $CHANGELOG_PATH | sed 's/\[//' | sed 's/\]//')
if [ "$BASE_VERSION" = "vnext" ]; then
echo "Version as set in $CHANGELOG_PATH is still 'vnext'. Please change it to a correct version"
exit 1
fi

echo "Version $BASE_VERSION is correct; continuing..."
4 changes: 4 additions & 0 deletions scripts/build/set-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ CHANGELOG_PATH="$ROOT_FOLDER/CHANGELOG"

echo "Determining version"
BASE_VERSION=$(head -n 1 $CHANGELOG_PATH | sed 's/\[//' | sed 's/\]//')
if [ "$BASE_VERSION" = "vnext" ]; then
BASE_VERSION=$(date +"%Y.%-m.%-d")
fi

VERSION="$BASE_VERSION.$1"
echo "Version is $VERSION"
echo "$VERSION" > "$ROOT_FOLDER/version.txt"

0 comments on commit d7b6914

Please sign in to comment.