Skip to content

Commit

Permalink
Merge pull request #9 from heavynimbus/develop
Browse files Browse the repository at this point in the history
💚 Fix CI
  • Loading branch information
heavynimbus authored Jun 2, 2024
2 parents 9ee08b9 + 1ce8d43 commit 1aff78e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 44 deletions.
64 changes: 44 additions & 20 deletions .github/workflows/upgrade-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,62 @@ jobs:

- name: Retrieve next version
id: next-version
shell: bash
run: |
echo "value=$(./get-next-version.sh)" >> $GITHUB_OUTPUT
VALUE=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
VERSION=$(echo $VALUE | cut -d'-' -f1)
MAJOR=$(echo $VERSION | cut -d'.' -f1)
MINOR=$(echo $VERSION | cut -d'.' -f2)
PATCH=$(echo $VERSION | cut -d'.' -f3)
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "major=$MAJOR" >> $GITHUB_OUTPUT
echo "minor=$MINOR" >> $GITHUB_OUTPUT
echo "patch=$PATCH" >> $GITHUB_OUTPUT
- name: Compute snapshot version
id: snapshot-version
shell: bash
run: |
MAJOR=${{ steps.next-version.outputs.value }}
MINOR=${{ steps.next-version.outputs.minor }}
PATCH=$((${{ steps.next-version.outputs.patch }} + 1))
echo "value=$MAJOR.$MINOR.$PATCH-SNAPSHOT" >> $GITHUB_OUTPUT
- name: Upgrade server pom version
shell: bash
run: |
mvn versions:set -DnewVersion=${{ steps.next-version.outputs.value }} --file server/pom.xml
- name: Upgrade version in README.md
shell: bash
run: |
sed -i 's/https:\/\/img.shields.io\/badge\/Version-[0-9]\+\.[0-9]\+\.[0-9]-blue/https:\/\/img.shields.io\/badge\/Version-${{ steps.next-version.outputs.value }}-blue/g' README.md
sed -i 's/image: heavynimbus\/mock-http-server:[0-9]\+\.[0-9]\+\.[0-9]/image: heavynimbus\/mock-http-server:${{ steps.next-version.outputs.value }}/g' README.md
- name: Upgrade server version
- name: Retrieve next version
id: next-version
run: |
./set-next-version.sh --pom server/pom.xml
echo "value=$(./get-next-version.sh)" >> $GITHUB_OUTPUT
- name: Add & Commit
id: add-and-commit
uses: EndBug/[email protected]
with:
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
message: "⬆️🚀 Upgrade version to ${{ steps.next-version.outputs.value }}"
add: "server/pom.xml"

- name: Create Tag ${{ steps.next-version.outputs.value }}
uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "v${{ steps.next-version.outputs.value }}"
commit_sha: ${{ steps.add-and-commit.outputs.commit_sha }}

- name: Push changes
id: push-changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -58,12 +99,6 @@ jobs:
tags: true
force: true

- name: Create Tag ${{ steps.next-version.outputs.value }}
uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "v${{ steps.next-version.outputs.value }}"

- name: Build Docker image ${{ steps.next-version.outputs.value }}
env:
NEXT_VERSION: ${{ steps.next-version.outputs.value }}
Expand Down Expand Up @@ -101,14 +136,3 @@ jobs:
branch: ${{ github.ref_name }}
tags: true
force: true

- name: Create PR from main to develop
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
title: "🔀 Upgrade version to ${{ steps.snapshot-version.outputs.value }}"
branch: "main"
base: "develop"
labels: "auto-merge"
assignees: "heavynimbus"
reviewers: "heavynimbus"
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Heavy Mock HTTP Server

![](https://img.shields.io/badge/Status-Under%20Development-red)
![](https://img.shields.io/badge/Version-0.0.0-blue)
![](https://img.shields.io/badge/License-MIT-blue)
![](https://img.shields.io/badge/Version-2.0.0-blue)
[![](https://img.shields.io/badge/License-GPL--3.0-blue)](./LICENSE.md)

![](https://img.shields.io/badge/Docker-1D63ED?logo=Docker)
![](https://img.shields.io/badge/SpringBoot-v3.3.0-6DB33F?logo=Spring)
Expand Down Expand Up @@ -58,34 +58,16 @@ endpoints:
- <regex>
headers:
<string>: <string>
response:
delay: <integer> # In milliseconds
status: <HTTP_STATUS> # OK | CREATED | BAD_REQUEST | ...
headers:
<string1>:
<string>:
- <string>
body: # Only one field of body can be used
# You can use the | character to write a multiline string
string: <string>
file: <string>
callbacks:
- delay: <integer> # In milliseconds
async: true | false
redirect: NEVER | ALWAYS | NORMAL # Default is NORMAL
version: HTTP_1_1 | HTTP_2 # Default is HTTP_1_1
connectTimeout: <duration> # Default is 10s (PT10S)
proxy:
host: <string>
port: <integer>
url: <string>
method: GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD # Default is GET
headers:
<string>: <string>
body:
string: <string>
file: <string>
```
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>heavynimbus</groupId>
<artifactId>heavy-mock-http-server</artifactId>
<version>0.0.3-SNAPSHOT</version>
<version>0.0.0-SNAPSHOT</version>
<description>
Mock HTTP server for development or testing purposes, with the ability to mock responses based on request
parameters.
Expand Down

0 comments on commit 1aff78e

Please sign in to comment.