diff --git a/.github/workflows/build-release-on-main-push.yml b/.github/workflows/build-release-on-main-push.yml index 1d4c050..c457420 100644 --- a/.github/workflows/build-release-on-main-push.yml +++ b/.github/workflows/build-release-on-main-push.yml @@ -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: @@ -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 @@ -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 }} \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/workflows/dependabot-pr-auto-merge.yml b/.github/workflows/dependabot-pr-auto-merge.yml index dd40f8e..30be268 100644 --- a/.github/workflows/dependabot-pr-auto-merge.yml +++ b/.github/workflows/dependabot-pr-auto-merge.yml @@ -1,6 +1,6 @@ name: dependabot-pr-auto-merge -on: pull_request_target +on: pull_request permissions: contents: write @@ -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}} \ No newline at end of file + PR_URL: ${{github.event.pull_request.html_url}} \ No newline at end of file diff --git a/.github/workflows/release-from-tag.yml b/.github/workflows/release-from-tag.yml deleted file mode 100644 index bc89d99..0000000 --- a/.github/workflows/release-from-tag.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: release-notes-from-tag - -on: - push: - tags: - - "*.*.*" - -jobs: - release-notes-from-tag: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: create-release-notes - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3b8d217..057ddbd 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 net.osslabz mexc-client - 0.1.1-SNAPSHOT + 0.1.42 ${project.groupId}:${project.artifactId} @@ -19,7 +18,7 @@ ${osslabz.encoding} ${osslabz.encoding} - 2024-10-22T18:59:17Z + 2024-10-23T01:14:24Z ${osslabz.java.version} @@ -48,7 +47,7 @@ scm:git:https://github.com/osslabz/mexc-client.git scm:git:https://github.com/osslabz/mexc-client.git https://github.com/osslabz/mexc-client - main + 0.1.42 @@ -120,7 +119,6 @@ 5.11.3 test - ch.qos.logback @@ -148,6 +146,7 @@ + true false osslabz-release @@ -155,8 +154,9 @@ [release] @{prefix} set version to @{releaseLabel} @{prefix} prepare for next development iteration - ConventionalCommitsVersionPolicy + + ConventionalCommitsVersionPolicy ([0-9]+\.[0-9]+\.[0-9]+)$ @@ -233,6 +233,11 @@ + + org.apache.maven.plugins + maven-jar-plugin + 3.4.2 + org.apache.maven.plugins maven-source-plugin diff --git a/src/main/java/net/osslabz/mexc/client/MexcMapper.java b/src/main/java/net/osslabz/mexc/client/MexcMapper.java index 479e979..d588bd5 100644 --- a/src/main/java/net/osslabz/mexc/client/MexcMapper.java +++ b/src/main/java/net/osslabz/mexc/client/MexcMapper.java @@ -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(); }