Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rvullriede committed Nov 11, 2024
2 parents ce88179 + 7f4ed0b commit 0d320c8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 35 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/build-release-on-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
build-release-on-main-push:
if: ${{ !contains(github.event.head_commit.message, '[release]') }} # prevent recursive releases
runs-on: ubuntu-latest

permissions:
Expand All @@ -18,7 +19,6 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
token: ${{secrets.PAT_DEPENDABOT_PR_AUTO_MERGE}}

- name: setup-jdk
uses: actions/setup-java@v4
Expand All @@ -33,15 +33,34 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: maven-build-verify
run: mvn --batch-mode --update-snapshots verify
run: mvn --batch-mode verify

- uses: qoomon/actions--setup-git@v1
- name: configure-git-user
uses: qoomon/actions--setup-git@v1
with:
user: actor
user: bot

- name: publish-on-maven-central
run: mvn --batch-mode -P osslabz-release clean release:clean release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

- name: 'get-latest-tag'
id: 'get-latest-tag'
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: create-release-notes
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
tag_name: ${{ steps.get-latest-tag.outputs.tag }}

- name: merge-main-to-dev
run: |
git fetch --unshallow
git checkout dev
git pull
git merge --no-ff main -m "[release] auto-merge released main back to dev"
git push
6 changes: 2 additions & 4 deletions .github/workflows/dependabot-pr-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dependabot-pr-auto-merge

on: pull_request_target
on: pull_request

permissions:
contents: write
Expand All @@ -19,10 +19,8 @@ jobs:
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.PAT_DEPENDABOT_PR_AUTO_MERGE}}

- name: dependabot-pr-auto-merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.PAT_DEPENDABOT_PR_AUTO_MERGE}}
PR_URL: ${{github.event.pull_request.html_url}}
18 changes: 0 additions & 18 deletions .github/workflows/release-from-tag.yml

This file was deleted.

19 changes: 12 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>net.osslabz</groupId>
<artifactId>mexc-client</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.1.42</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>
Expand All @@ -19,7 +18,7 @@
<project.build.sourceEncoding>${osslabz.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${osslabz.encoding}</project.reporting.outputEncoding>

<project.build.outputTimestamp>2024-10-22T18:59:17Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-10-23T01:14:24Z</project.build.outputTimestamp>

<maven.compiler.release>${osslabz.java.version}</maven.compiler.release>

Expand Down Expand Up @@ -48,7 +47,7 @@
<connection>scm:git:https://github.com/osslabz/mexc-client.git</connection>
<developerConnection>scm:git:https://github.com/osslabz/mexc-client.git</developerConnection>
<url>https://github.com/osslabz/mexc-client</url>
<tag>main</tag>
<tag>0.1.42</tag>
</scm>

<dependencies>
Expand Down Expand Up @@ -120,7 +119,6 @@
<version>5.11.3</version>
<scope>test</scope>
</dependency>

<!-- default logging impl for tests -->
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down Expand Up @@ -148,15 +146,17 @@
</dependency>
</dependencies>
<configuration>
<!-- settings from the maven-release-plugin itself -->
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>osslabz-release</releaseProfiles>
<tagNameFormat>@{project.version}</tagNameFormat>
<scmCommentPrefix>[release]</scmCommentPrefix>
<scmReleaseCommitComment>@{prefix} set version to @{releaseLabel}</scmReleaseCommitComment>
<scmDevelopmentCommitComment>@{prefix} prepare for next development iteration</scmDevelopmentCommitComment>
<projectVersionPolicyId>ConventionalCommitsVersionPolicy</projectVersionPolicyId>

<!-- settings from the conventional-commits-version-policy -->
<projectVersionPolicyId>ConventionalCommitsVersionPolicy</projectVersionPolicyId>
<projectVersionPolicyConfig>
<versionTag>([0-9]+\.[0-9]+\.[0-9]+)$</versionTag>
</projectVersionPolicyConfig>
Expand Down Expand Up @@ -233,6 +233,11 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/osslabz/mexc/client/MexcMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ZonedDateTime epochSecondsToDate(long epochSeconds) {


BigDecimal calcAvgPrice(RawOhlc.OhlData.OhlcContent content) {
return CryptoMathUtils.isLargerZero(content.getVolume()) && CryptoMathUtils.isLargerZero(content.getQuantity()) ? content.getVolume().divide(content.getQuantity(), 8, RoundingMode.HALF_UP) : BigDecimal.ZERO;
return CryptoMathUtils.isLargerZero(content.getVolume()) && CryptoMathUtils.isLargerZero(content.getQuantity()) ? content.getVolume().divide(content.getQuantity(), 8, RoundingMode.HALF_UP) : content.getClosePrice();
}


Expand Down

0 comments on commit 0d320c8

Please sign in to comment.