-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from heavynimbus/develop
💚 Fix CI
- Loading branch information
Showing
3 changed files
with
50 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -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 }} | ||
|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters