From 6d07acb8ce1433ca4f10c02034dbfc801ccc2dff Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 18:53:30 -0600 Subject: [PATCH 01/19] unbreak the break signal --- .../io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java index 17a9203e2..186b25ad0 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java @@ -340,7 +340,7 @@ public class Scenario implements Callable { } } - public synchronized void finish() { + public void finish() { logger.debug("finishing scenario"); endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment if (this.state == State.Running) { From 32486b3d64731cbe77995b521b4b5f5ee2722239 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 18:53:30 -0600 Subject: [PATCH 02/19] unbreak the break signal --- .../io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java index 17a9203e2..186b25ad0 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/scenario/Scenario.java @@ -340,7 +340,7 @@ public class Scenario implements Callable { } } - public synchronized void finish() { + public void finish() { logger.debug("finishing scenario"); endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment if (this.state == State.Running) { From 086451794487381a7c5e3113682eb4be099f6b01 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 19:03:20 -0600 Subject: [PATCH 03/19] preview build testing --- scripts/get-release-version.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/get-release-version.sh b/scripts/get-release-version.sh index af729b24e..91beeb043 100755 --- a/scripts/get-release-version.sh +++ b/scripts/get-release-version.sh @@ -17,15 +17,14 @@ set -e -export branch=$(git status --branch --porcelain | cut -d' ' -f2) - -if [[ $branch =~ main ]] -then - printf "On branch main, continuing\n" 1>&2 -else - printf "Not branch main, bailing out\n" 1>&2 - exit 2 -fi +#export branch=$(git status --branch --porcelain | cut -d' ' -f2) +#if [[ $branch =~ main ]] +#then +# printf "On branch main, continuing\n" 1>&2 +#else +# printf "Not branch main, bailing out\n" 1>&2 +# exit 2 +#fi export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) From 6a2132669194307e2239a9601ca53e9a42a44801 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 19:50:14 -0600 Subject: [PATCH 04/19] actions testing --- scripts/get-preview-version.sh | 10 ---------- scripts/get-release-version.sh | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/scripts/get-preview-version.sh b/scripts/get-preview-version.sh index 3d7f1e4fd..09a4b7557 100755 --- a/scripts/get-preview-version.sh +++ b/scripts/get-preview-version.sh @@ -17,16 +17,6 @@ set -e -export branch=$(git status --branch --porcelain | cut -d' ' -f2) - -if [[ $branch =~ main ]] -then - printf "On branch main, continuing\n" 1>&2 -else - printf "Not branch main, bailing out\n" 1>&2 - exit 2 -fi - export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) if [[ $REVISION =~ ([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT ]] then diff --git a/scripts/get-release-version.sh b/scripts/get-release-version.sh index 91beeb043..6ae789234 100755 --- a/scripts/get-release-version.sh +++ b/scripts/get-release-version.sh @@ -17,16 +17,6 @@ set -e -#export branch=$(git status --branch --porcelain | cut -d' ' -f2) -#if [[ $branch =~ main ]] -#then -# printf "On branch main, continuing\n" 1>&2 -#else -# printf "Not branch main, bailing out\n" 1>&2 -# exit 2 -#fi - - export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) if [[ $REVISION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT$ ]] then From be65f812e08426b9487a830c45d0f37294fe41f3 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 19:52:05 -0600 Subject: [PATCH 05/19] allow forcing preview tag update --- scripts/tag-preview-build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/tag-preview-build b/scripts/tag-preview-build index 5692892dc..1fc9316e3 100755 --- a/scripts/tag-preview-build +++ b/scripts/tag-preview-build @@ -6,5 +6,10 @@ RELEASE_VERSION=${CURRENT_VERSION%%-SNAPSHOT} PREVIEW_TAG="${RELEASE_VERSION}-preview" printf "preview tag: '%s'\n" "${PREVIEW_TAG}" -git tag "${PREVIEW_TAG}" +if [ "$1" == "-f" ] +then + git tag -f "${PREVIEW_TAG}" +else + git tag "${PREVIEW_TAG}" +fi From 6b0633d4a3e58657eff30933705f06a3e712f184 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 20:19:54 -0600 Subject: [PATCH 06/19] update notes filenames --- .github/workflows/preview.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 3d5eb5116..4a9247563 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -117,7 +117,7 @@ jobs: id: prepare_summary run: | #summary=$(scripts/release-notes.sh) - summary=$(cat RELEASENOTES.md) + summary=$(cat PREVIEW_NOTES.md) summary="${summary//'%'/'%25'}" summary="${summary//$'\n'/'%0A'}" summary="${summary//$'\r'/'%0D'}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30e4cca93..736feb091 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,7 +117,7 @@ jobs: id: prepare_summary run: | #summary=$(scripts/release-notes.sh) - summary=$(cat RELEASENOTES.md) + summary=$(cat RELEASE_NOTES.md) summary="${summary//'%'/'%25'}" summary="${summary//$'\n'/'%0A'}" summary="${summary//$'\r'/'%0D'}" From 910e871a83026bc828b844006dbe046b54931010 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 20:43:41 -0600 Subject: [PATCH 07/19] remove extra node version parameters --- .github/workflows/preview.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 4a9247563..84427d2b6 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -17,13 +17,10 @@ jobs: - name: checkout repo uses: actions/checkout@v3 - with: - node-version: '16' - name: setup java uses: actions/setup-java@v3 with: - node-version: '16' distribution: 'temurin' java-version: '17' java-package: jdk @@ -46,7 +43,6 @@ jobs: - name: Cache Maven packages uses: actions/cache@v2 with: - node-version: '16' path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 @@ -64,20 +60,16 @@ jobs: - name: Setup docker buildx uses: docker/setup-buildx-action@v1 - with: - node-version: '16' - name: docker hub login uses: docker/login-action@v1 with: - node-version: '16' username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: docker test build uses: docker/build-push-action@v2 with: - node-version: '16' context: . file: Dockerfile pull: true @@ -99,7 +91,6 @@ jobs: - name: upload artifacts uses: actions/upload-artifact@v1 with: - node-version: '16' name: binaries path: staging @@ -136,7 +127,6 @@ jobs: - name: docker push to hub uses: docker/build-push-action@v2 with: - node-version: '16' context: . platforms: linux/amd64,linux/arm64 file: Dockerfile @@ -150,7 +140,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - node-version: '16' tag_name: ${{ env.PREVIEW_VERSION }} release_name: Release ${{ env.PREVIEW_VERSION }} draft: false @@ -163,7 +152,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - node-version: '16' upload_url: ${{ steps.create_github_release.outputs.upload_url }} asset_path: nb5/target/nb5.jar asset_name: nb5.jar @@ -175,7 +163,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - node-version: '16' upload_url: ${{ steps.create_github_release.outputs.upload_url }} asset_path: nb5/target/nb5 asset_name: nb5 @@ -185,7 +172,6 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - node-version: '16' name: test-results path: | [a-zA-Z]**/logs/* From 7047f4486972f9c06458b99e5fabe95de2764443 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 20:58:22 -0600 Subject: [PATCH 08/19] remove second tagging --- .github/workflows/preview.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 84427d2b6..beb22e9de 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -114,12 +114,6 @@ jobs: summary="${summary//$'\r'/'%0D'}" echo "release_summary=$summary" >> $GITHUB_STATE - - name: tag preview version - run: | - git tag nb5-${{ env.PREVIEW_VERSION }} - git tag -f nb5-preview - git push --tags - - name: bump minor version run: | scripts/bump-minor-version From 1986b8cdbcabba4082113728261d8daeec7e2373 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 21:17:57 -0600 Subject: [PATCH 09/19] replace release action --- .github/workflows/preview.yml | 75 ++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index beb22e9de..7fa6b7186 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -128,40 +128,53 @@ jobs: push: true tags: ${{ env.DOCKER_TAGS }} - - name: create github release - id: create_github_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: update github release + id: update_github_release + uses: johnwbyrd/update-release@v1 with: - tag_name: ${{ env.PREVIEW_VERSION }} - release_name: Release ${{ env.PREVIEW_VERSION }} - draft: false - prerelease: true + token: ${{ secrets.GITHUB_TOKEN }} + files: + - nb5/target/nb5 + - nb5/target/nb5.jar + release: Preview Release ${{ env.PREVIEW_VERSION }} + tag: ${{ env.PREVIEW_VERSION }} + message: preview release ${{ env.PREVIEW_VERSION }} body: ${{ steps.prepare_summary.outputs.release_summary }} - - name: upload nb.jar to github release - id: upload-nb-jar - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_github_release.outputs.upload_url }} - asset_path: nb5/target/nb5.jar - asset_name: nb5.jar - asset_content_type: application/octet-stream - - - name: upload nb binary to github release - id: upload-nb-binary - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_github_release.outputs.upload_url }} - asset_path: nb5/target/nb5 - asset_name: nb5 - asset_content_type: application/octet-stream - +# - name: create github release +# id: create_github_release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# tag_name: ${{ env.PREVIEW_VERSION }} +# release_name: Release ${{ env.PREVIEW_VERSION }} +# draft: false +# prerelease: true +# body: ${{ steps.prepare_summary.outputs.release_summary }} +# +# - name: upload nb.jar to github release +# id: upload-nb-jar +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.create_github_release.outputs.upload_url }} +# asset_path: nb5/target/nb5.jar +# asset_name: nb5.jar +# asset_content_type: application/octet-stream +# +# - name: upload nb binary to github release +# id: upload-nb-binary +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.create_github_release.outputs.upload_url }} +# asset_path: nb5/target/nb5 +# asset_name: nb5 +# asset_content_type: application/octet-stream +# - name: Archive Test Results if: always() uses: actions/upload-artifact@v3 From 1b2a773ce6c01872def44086e4cce55230902da8 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 21:20:00 -0600 Subject: [PATCH 10/19] update files paths --- .github/workflows/preview.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 7fa6b7186..b0e4049b1 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -133,9 +133,7 @@ jobs: uses: johnwbyrd/update-release@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - files: - - nb5/target/nb5 - - nb5/target/nb5.jar + files: nb5/target/nb5 nb5/target/nb5.jar release: Preview Release ${{ env.PREVIEW_VERSION }} tag: ${{ env.PREVIEW_VERSION }} message: preview release ${{ env.PREVIEW_VERSION }} From 639dbf2d6c8a521ab3ab92a12b2a60d135218b45 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 21:21:37 -0600 Subject: [PATCH 11/19] update action version --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b0e4049b1..edae44d9b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -130,7 +130,7 @@ jobs: - name: update github release id: update_github_release - uses: johnwbyrd/update-release@v1 + uses: johnwbyrd/update-release@v1.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} files: nb5/target/nb5 nb5/target/nb5.jar From 2d3263cfbe038135d16beee1598d79b63afcb446 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 21:36:49 -0600 Subject: [PATCH 12/19] make release tag distinct --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index edae44d9b..eb250a2a3 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -135,7 +135,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} files: nb5/target/nb5 nb5/target/nb5.jar release: Preview Release ${{ env.PREVIEW_VERSION }} - tag: ${{ env.PREVIEW_VERSION }} + tag: nb5-${{ env.PREVIEW_VERSION }} message: preview release ${{ env.PREVIEW_VERSION }} body: ${{ steps.prepare_summary.outputs.release_summary }} From 2b85c1cce150d571c7db4ee96638fb99dc33479f Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 21:54:54 -0600 Subject: [PATCH 13/19] versions and release action update --- .github/workflows/preview.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index eb250a2a3..82cb0212a 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -41,7 +41,7 @@ jobs: df -h - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v3.2.3 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -59,16 +59,16 @@ jobs: mvn clean package -Drevision="${{ env.PREVIEW_VERSION }}" - name: Setup docker buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2.2.1 - name: docker hub login - uses: docker/login-action@v1 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: docker test build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3.3.0 with: context: . file: Dockerfile @@ -128,16 +128,21 @@ jobs: push: true tags: ${{ env.DOCKER_TAGS }} - - name: update github release - id: update_github_release - uses: johnwbyrd/update-release@v1.0.0 + - name: create github release + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/') with: - token: ${{ secrets.GITHUB_TOKEN }} - files: nb5/target/nb5 nb5/target/nb5.jar - release: Preview Release ${{ env.PREVIEW_VERSION }} - tag: nb5-${{ env.PREVIEW_VERSION }} - message: preview release ${{ env.PREVIEW_VERSION }} body: ${{ steps.prepare_summary.outputs.release_summary }} + draft: false + prerelease: true + name: Release ${{ env.PREVIEW_VERSION }} + fail_on_unmatched_files: true + tag: ${{ env.PREVIEW_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} +# target_commitish: ${{ env.PREVIEW_VERSION }} + files: | + nb5/target/nb5 + nb5/target/nb5.jar # - name: create github release # id: create_github_release @@ -172,7 +177,7 @@ jobs: # asset_path: nb5/target/nb5 # asset_name: nb5 # asset_content_type: application/octet-stream -# + - name: Archive Test Results if: always() uses: actions/upload-artifact@v3 From f61de1257e4efa5fdbc17526310649770317f6a4 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 25 Jan 2023 22:10:17 -0600 Subject: [PATCH 14/19] updated preview notes, updated notes path --- .github/workflows/preview.yml | 6 +++--- PREVIEW_NOTES.md | 32 +++++++++++++++++++++++++++++--- scripts/release-notes.sh | 7 ++++--- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 82cb0212a..fe14136b0 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -132,14 +132,14 @@ jobs: uses: softprops/action-gh-release@v0.1.15 if: startsWith(github.ref, 'refs/tags/') with: - body: ${{ steps.prepare_summary.outputs.release_summary }} +# body: ${{ steps.prepare_summary.outputs.release_summary }} + body_path: PREVIEW_NOTES.md draft: false prerelease: true name: Release ${{ env.PREVIEW_VERSION }} fail_on_unmatched_files: true - tag: ${{ env.PREVIEW_VERSION }} + tag_name: ${{ env.PREVIEW_VERSION }} token: ${{ secrets.GITHUB_TOKEN }} -# target_commitish: ${{ env.PREVIEW_VERSION }} files: | nb5/target/nb5 nb5/target/nb5.jar diff --git a/PREVIEW_NOTES.md b/PREVIEW_NOTES.md index 192369874..6240554fa 100644 --- a/PREVIEW_NOTES.md +++ b/PREVIEW_NOTES.md @@ -1,7 +1,33 @@ -- e4e94f9e8 (HEAD -> main) support version bumping +- 2b85c1cce (HEAD -> main, tag: 5.17.1-preview) versions and release action update +- 2d3263cfb make release tag distinct +- 639dbf2d6 update action version +- 1b2a773ce update files paths +- 1986b8cdb replace release action +- 7047f4486 (origin/main) remove second tagging +- 910e871a8 remove extra node version parameters +- 6b0633d4a (tag: nb5-preview, tag: nb5-5.17.1-preview) update notes filenames +- be65f812e allow forcing preview tag update +- 2a43dd077 Merge branch 'main' of github.com:nosqlbench/nosqlbench +- 6a2132669 actions testing +- 4bd0513f9 Merge pull request #950 from nosqlbench/nosqlbench-949-sigint +- 086451794 preview build testing +- 32486b3d6 unbreak the break signal +- 6d07acb8c (origin/nosqlbench-949-sigint, nosqlbench-949-sigint) unbreak the break signal +- c6aa66f50 Update DOWNLOADS.md +- 5b90831a9 Update DOWNLOADS.md +- 3e3427fca update job names +- 3f0417c96 fix preview trigger +- 29ed32d91 update revision +- 24657248f use tags only for preview and release triggers +- e254eafa8 check for main branch on preview and release +- 0ae3bd085 make preview and release tag based +- 027fc4a89 version, tagging updates +- 402154e4c docs and scripts +- ee2bda24e preview testing +- e4e94f9e8 support version bumping - 8a2c696eb allow bumping versions -- c19b2388e (origin/prerelease-testing, origin/main, prerelease-testing) standardize on main/preview/release naming -- 5facaddfe (tag: 5.17.1-prerelease) actions testing +- c19b2388e (origin/prerelease-testing, prerelease-testing) standardize on main/preview/release naming +- 5facaddfe actions testing - 33c55809d actions testing - fcdddf307 simplify version - ac7f5762c actions cleanup diff --git a/scripts/release-notes.sh b/scripts/release-notes.sh index 7727ed814..00a95e0f4 100755 --- a/scripts/release-notes.sh +++ b/scripts/release-notes.sh @@ -5,13 +5,14 @@ git log --oneline --decorate --max-count=1000 > /tmp/gitlog.txt readarray lines < /tmp/gitlog.txt for line in "${lines[@]}" do - printf "line: %s\n" "${line}" +# printf "line: %s\n" "${line}" if [[ $line =~ \(tag:\ ([a-zA-z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\)-preview.+ ]] then - echo "PREVIEW" + true +# echo "PREVIEW" elif [[ $line =~ \(tag:\ ([a-zA-Z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\).+ ]] then - echo "RELEASE" +# echo "RELEASE" # printf "no more lines after $line" 1>&2 break elif [[ $line =~ \[maven-release-plugin\] ]] From 2e85f21a7968b5acf563146d67577968164352fb Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 26 Jan 2023 00:26:56 -0600 Subject: [PATCH 15/19] generating release notes from gh --- .github/workflows/preview.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index fe14136b0..b41d9a294 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -128,14 +128,16 @@ jobs: push: true tags: ${{ env.DOCKER_TAGS }} + # https://github.com/softprops/action-gh-release - name: create github release uses: softprops/action-gh-release@v0.1.15 if: startsWith(github.ref, 'refs/tags/') with: # body: ${{ steps.prepare_summary.outputs.release_summary }} - body_path: PREVIEW_NOTES.md +# body_path: PREVIEW_NOTES.md draft: false prerelease: true + generate_release_notes: true name: Release ${{ env.PREVIEW_VERSION }} fail_on_unmatched_files: true tag_name: ${{ env.PREVIEW_VERSION }} From 56be33ae928a1360565a621e6308c2d96184739b Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 26 Jan 2023 00:53:32 -0600 Subject: [PATCH 16/19] sync preview and release logic --- .github/workflows/preview.yml | 9 +- .github/workflows/release.yml | 151 ++++++++++++++++----------------- scripts/get-release-version.sh | 16 +++- scripts/tag-release-build | 7 +- 4 files changed, 101 insertions(+), 82 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b41d9a294..b325e4409 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,9 +1,12 @@ name: preview # This workflow should run for any push which is a preview build. -# Preview builds are indicated with changes to PREVIEW_NOTES.md. +# Preview builds are indicated with a tag that ends in -preview # In order to effect this, you can do the following: -# scripts/release-notes.sh > PREVIEW_NOTES.md +# scripts/tag-preview-build +# If you want to replace a build, you can use -f and then +# push the update to the tag like push -f origin , +# although this should never be done! on: push: @@ -138,7 +141,7 @@ jobs: draft: false prerelease: true generate_release_notes: true - name: Release ${{ env.PREVIEW_VERSION }} + name: Preview ${{ env.PREVIEW_VERSION }} fail_on_unmatched_files: true tag_name: ${{ env.PREVIEW_VERSION }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 736feb091..c78d8121c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,12 @@ name: release -# This workflow should run for any push which is a preview build. -# Preview builds are indicated with changes to PREVIEW_NOTES.md. +# This workflow should run for any push which is a release build. +# Release builds are indicated with a tag that ends in -release # In order to effect this, you can do the following: -# scripts/release-notes.sh > RELEASE_NOTES.md +# scripts/tag-release-build +# If you want to replace a build, you can use -f and then +# push the update to the tag like push -f origin , +# although this should never be done! on: push: @@ -17,13 +20,10 @@ jobs: - name: checkout repo uses: actions/checkout@v3 - with: - node-version: '16' - name: setup java uses: actions/setup-java@v3 with: - node-version: '16' distribution: 'temurin' java-version: '17' java-package: jdk @@ -44,9 +44,8 @@ jobs: df -h - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v3.2.3 with: - node-version: '16' path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 @@ -54,30 +53,28 @@ jobs: - name: read versions run: | set -x - RELEASE_REVISION=$(scripts/get-release-version.sh) - echo "RELEASE_REVISION=${RELEASE_REVISION}" >> $GITHUB_ENV - echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_REVISION},nosqlbench/nosqlbench:latest" >> $GITHUB_ENV + RELEASE_VERSION=$(scripts/get-release-version.sh) + RELEASE_VERSION_NUMERIC=$(scripts/get-release-version.sh -n) + RELEASE_VERSION_SHORT=$(scripts/get-release-version.sh -s) + echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV + echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_VERSION_NUMERIC},nosqlbench/nosqlbench:${RELEASE_VERSION_SHORT}-latest" >> $GITHUB_ENV - name: build release revision run: | - mvn clean package -Drevision="${{ env.RELEASE_REVISION }}" + mvn clean package -Drevision="${{ env.RELEASE_VERSION }}" - name: Setup docker buildx - uses: docker/setup-buildx-action@v1 - with: - node-version: '16' + uses: docker/setup-buildx-action@v2.2.1 - name: docker hub login - uses: docker/login-action@v1 + uses: docker/login-action@v2.1.0 with: - node-version: '16' username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: docker test build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3.3.0 with: - node-version: '16' context: . file: Dockerfile pull: true @@ -87,7 +84,7 @@ jobs: - name: sanity check docker image run: | - docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_REVISION }} --version + docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }} --version - name: bundle artifacts run: | @@ -99,40 +96,26 @@ jobs: - name: upload artifacts uses: actions/upload-artifact@v1 with: - node-version: '16' name: binaries path: staging -# - name: generate javadoc -# run: mvn javadoc:aggregate-jar -# continue-on-error: false -# -# - name: upload javadoc -# uses: actions/upload-artifact@v3 -# with: -# name: javadoc -# path: target/nosqlbench-*-javadoc.jar + # - name: generate javadoc + # run: mvn javadoc:aggregate-jar + # continue-on-error: false + # + # - name: upload javadoc + # uses: actions/upload-artifact@v3 + # with: + # name: javadoc + # path: target/nosqlbench-*-javadoc.jar - - name: prepare release summary - id: prepare_summary + - name: bump minor version run: | - #summary=$(scripts/release-notes.sh) - summary=$(cat RELEASE_NOTES.md) - summary="${summary//'%'/'%25'}" - summary="${summary//$'\n'/'%0A'}" - summary="${summary//$'\r'/'%0D'}" - echo "release_summary=$summary" >> $GITHUB_STATE - - - name: tag release - run: | - git tag nb5-${{ env.RELEASE_REVISION }} - git tag -f nb5-release - git push --tags + scripts/bump-minor-version - name: docker push to hub uses: docker/build-push-action@v2 with: - node-version: '16' context: . platforms: linux/amd64,linux/arm64 file: Dockerfile @@ -140,48 +123,62 @@ jobs: push: true tags: ${{ env.DOCKER_TAGS }} + # https://github.com/softprops/action-gh-release - name: create github release - id: create_github_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/') with: - node-version: '16' - tag_name: ${{ env.RELEASE_REVISION }} - release_name: Release ${{ env.RELEASE_REVISION }} + # body: ${{ steps.prepare_summary.outputs.release_summary }} + # body_path: PREVIEW_NOTES.md draft: false prerelease: true - body: ${{ steps.prepare_summary.outputs.release_summary }} + generate_release_notes: true + name: Release ${{ env.RELEASE_VERSION }} + fail_on_unmatched_files: true + tag_name: ${{ env.RELEASE_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + files: | + nb5/target/nb5 + nb5/target/nb5.jar - - name: upload nb.jar to github release - id: upload-nb-jar - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - node-version: '16' - upload_url: ${{ steps.create_github_release.outputs.upload_url }} - asset_path: nb5/target/nb5.jar - asset_name: nb5.jar - asset_content_type: application/octet-stream - - - name: upload nb binary to github release - id: upload-nb-binary - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - node-version: '16' - upload_url: ${{ steps.create_github_release.outputs.upload_url }} - asset_path: nb5/target/nb5 - asset_name: nb5 - asset_content_type: application/octet-stream + # - name: create github release + # id: create_github_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: ${{ env.RELEASE_VERSION }} + # release_name: Release ${{ env.RELEASE_VERSION }} + # draft: false + # prerelease: true + # body: ${{ steps.prepare_summary.outputs.release_summary }} + # + # - name: upload nb.jar to github release + # id: upload-nb-jar + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_github_release.outputs.upload_url }} + # asset_path: nb5/target/nb5.jar + # asset_name: nb5.jar + # asset_content_type: application/octet-stream + # + # - name: upload nb binary to github release + # id: upload-nb-binary + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_github_release.outputs.upload_url }} + # asset_path: nb5/target/nb5 + # asset_name: nb5 + # asset_content_type: application/octet-stream - name: Archive Test Results if: always() uses: actions/upload-artifact@v3 with: - node-version: '16' name: test-results path: | [a-zA-Z]**/logs/* diff --git a/scripts/get-release-version.sh b/scripts/get-release-version.sh index 6ae789234..27ecc6165 100755 --- a/scripts/get-release-version.sh +++ b/scripts/get-release-version.sh @@ -15,6 +15,12 @@ # limitations under the License. # +if [ "$1" == "-n" ] +then numeric=true +elif [ "$1" == "-s" ] +then short=true +fi + set -e export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) @@ -49,6 +55,14 @@ else exit 5 fi -printf "%s.%s.%s-release\n" "${@:2:3}" +if [ "$numeric" == "true" ] +then + printf "%s.%s.%s\n" "${@:2:3}" +elif [ "$short" == "true" ] +then + printf "%s.%s\n" "${@:2:2}" +else + printf "%s.%s.%s-release\n" "${@:2:3}" +fi diff --git a/scripts/tag-release-build b/scripts/tag-release-build index 0b42ad19b..d9fbae4bf 100755 --- a/scripts/tag-release-build +++ b/scripts/tag-release-build @@ -6,5 +6,10 @@ RELEASE_VERSION=${CURRENT_VERSION%%-SNAPSHOT} RELEASE_TAG="${RELEASE_VERSION}-release" printf "release tag: '%s'\n" "${RELEASE_TAG}" -git tag "${RELEASE_TAG}" +if [ "$1" == "-f" ] +then + git tag -f "${RELEASE_TAG}" +else + git tag "${RELEASE_TAG}" +fi From 955e472efd2d10e541d8d16c9c2235cb04fbb23d Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 26 Jan 2023 00:59:43 -0600 Subject: [PATCH 17/19] make build, prerelease and release separate triggers --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa393ec5f..b3d55f2f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,9 @@ name: build on: push: - paths: - - "!RELEASE_NOTES.md" - - "!PREVIEW_NOTES.md" + tags: + - "![0-9]+.[0-9]+.[0-9]+-preview" + - "![0-9]+.[0-9]+.[0-9]+-release" pull_request: jobs: From db7aba16069de91e2ff3f74913f9aa6f20429e4e Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 26 Jan 2023 01:08:01 -0600 Subject: [PATCH 18/19] update numeric docker version --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c78d8121c..896c54390 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,6 +57,7 @@ jobs: RELEASE_VERSION_NUMERIC=$(scripts/get-release-version.sh -n) RELEASE_VERSION_SHORT=$(scripts/get-release-version.sh -s) echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV + echo "RELEASE_VERSION_NUMERIC=${RELEASE_VERSION_NUMERIC}" >> $GITHUB_ENV echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_VERSION_NUMERIC},nosqlbench/nosqlbench:${RELEASE_VERSION_SHORT}-latest" >> $GITHUB_ENV - name: build release revision @@ -84,7 +85,7 @@ jobs: - name: sanity check docker image run: | - docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }} --version + docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_VERSION_NUMERIC }} --version - name: bundle artifacts run: | From a1e8de45a4e0d9c146a1a26ebe59d25b6268a812 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 26 Jan 2023 01:10:32 -0600 Subject: [PATCH 19/19] make codeQL run with normal builds only --- .github/workflows/codeql-analysis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1952e496b..89eb3dd33 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,6 +14,10 @@ name: "CodeQL" on: push: branches: [ main ] + tags: + - "![0-9]+.[0-9]+.[0-9]+-preview" + - "![0-9]+.[0-9]+.[0-9]+-release" + pull_request: # The branches below must be a subset of the branches above branches: [ main ]