standardize on main/preview/release naming

This commit is contained in:
Jonathan Shook 2023-01-23 18:59:22 -06:00
parent 5facaddfe5
commit c19b2388e0
6 changed files with 365 additions and 13 deletions

View File

@ -4,6 +4,7 @@ on:
push:
paths:
- "!RELEASENOTES.md"
- "!PRERELEASE_NOTES.md"
pull_request:
jobs:

253
.github/workflows/preview.yml vendored Normal file
View File

@ -0,0 +1,253 @@
name: prerelease
on:
push:
branches:
- main
paths:
- PREVIEW_NOTES.md
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-package: jdk
architecture: x64
- name: set git username
run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
- name: set git email
run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- 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
- name: read versions
run: |
set -x
PREVIEW_VERSION=$(scripts/get-preview-version.sh)
echo "PREVIEW_VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${PREVIEW_VERSION},nosqlbench/nosqlbench:preview" >> $GITHUB_ENV
- name: build preview revision
run: |
mvn clean package -Drevision="${{ env.PREVIEW_VERSION }}"
- 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
push: false
load: true
tags: ${{ env.DOCKER_TAGS }}
- name: sanity check docker image
run: |
docker run --rm nosqlbench/nosqlbench:${{ env.PREVIEW_VERSION }} --version
- name: bundle artifacts
run: |
pwd
ls -l
mkdir staging
cp nb5/target/nb5.jar nb5/target/nb5 staging
- name: upload artifacts
uses: actions/upload-artifact@v1
with:
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: prepare release summary
id: prepare_summary
run: |
#summary=$(scripts/release-notes.sh)
summary=$(cat RELEASENOTES.md)
summary="${summary//'%'/'%25'}"
summary="${summary//$'\n'/'%0A'}"
summary="${summary//$'\r'/'%0D'}"
echo "release_summary=$summary" >> $GITHUB_STATE
- name: tag preview version
run: |
git tag ${{ env.PREVIEW_VERSION }}
git push --tags
- name: docker push to hub
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
pull: true
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 }}
with:
node-version: '16'
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:
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:
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:
name: test-results
path: |
[a-zA-Z]**/logs/*
# javadocs:
# needs: release
# runs-on: ubuntu-20.04
# steps:
# - name: set git username
# run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
# - name: set git email
# run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
# - name: download javadocs
# uses: actions/download-artifact@v3
# with:
# name: javadoc
# - run: ls -la
# - name: unpackage javadoc
# run: unzip nosqlbench-*-javadoc.jar
# - run: ls -la
# - name: Push javadocs
# uses: ad-m/github-push-action@master
# with:
# repository: nosqlbench/nosqlbench-javadoc
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: main
#
#
# docs:
# needs: release
# runs-on: ubuntu-20.04
# steps:
#
# - name: set git username
# run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
#
# - name: set git email
# run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
#
# - name: download guidebook
# uses: actions/download-artifact@v1
# with:
# name: guidebook
# path: guidebook
#
# - run: ls -la
#
# - name: clone nosqlbench-docs
# env:
# NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
# NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
# run: |
# git clone https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git nosqlbench-docs
# cd nosqlbench-docs
# echo "files listing"
# find .
# git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-docs.git
# git remote -v
#
# Disabling this because it will be replaced soon.
# - name: push changes
# env:
# NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
# NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
# run: |
# rsync -av --delete guidebook/guidebook/ nosqlbench-docs/docs/
# echo "docs.nosqlbench.io" > nosqlbench-docs/docs/CNAME
# cd nosqlbench-docs
# git add docs
# git add -u
# CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
# echo "found $CHANGES to push for doc updates"
# if (( $CHANGES > 0 ))
# then
# git commit -m"docs update for $GITHUB_REF"
# git push
# fi

View File

@ -1,9 +1,9 @@
name: prerelease
name: release
on:
push:
branches:
- prerelease-testing
- main
paths:
- RELEASENOTES.**
@ -48,13 +48,13 @@ jobs:
- name: read versions
run: |
set -x
PRERELEASE_REVISION=$(scripts/get-prerelease-version.sh)
echo "PRERELEASE_REVISION=${PRERELEASE_REVISION}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${PRERELEASE_REVISION},nosqlbench/nosqlbench:prerelease" >> $GITHUB_ENV
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
- name: build prerelease revision
- name: build release revision
run: |
mvn clean package -Drevision="${{ env.PRERELEASE_REVISION }}"
mvn clean package -Drevision="${{ env.RELEASE_REVISION }}"
- name: Setup docker buildx
uses: docker/setup-buildx-action@v1
@ -81,7 +81,7 @@ jobs:
- name: sanity check docker image
run: |
docker run --rm nosqlbench/nosqlbench:${{ env.PRERELEASE_REVISION }} --version
docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_REVISION }} --version
- name: bundle artifacts
run: |
@ -116,9 +116,9 @@ jobs:
summary="${summary//$'\r'/'%0D'}"
echo "release_summary=$summary" >> $GITHUB_STATE
- name: tag prerelease
- name: tag release
run: |
git tag ${{ env.PRERELEASE_REVISION }}
git tag ${{ env.RELEASE_REVISION }}
git push --tags
- name: docker push to hub
@ -138,8 +138,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: '16'
tag_name: ${{ env.PRERELEASE_REVISION }}
release_name: Release ${{ env.PRERELEASE_REVISION }}
tag_name: ${{ env.RELEASE_REVISION }}
release_name: Release ${{ env.RELEASE_REVISION }}
draft: false
prerelease: true
body: ${{ steps.prepare_summary.outputs.release_summary }}

76
PREVIEW_NOTES.md Normal file
View File

@ -0,0 +1,76 @@
- 5facaddfe (HEAD -> prerelease-testing, origin/prerelease-testing) actions testing
- 33c55809d actions testing
- fcdddf307 simplify version
- ac7f5762c actions cleanup
- 6a118d289 naming fixes
- adb40cec4 version fixes
- 1adb4e4af fix version, again
- 801ed23ce fix revision var
- 430bee3eb fix version reference
- 1f5b133f9 version fixes
- 1793eb22f fixed script name
- 320173997 prerelease testing
- f31ea802d prerelease testing
- 0de184e42 fixed typo
- b40aec8a7 prerelease testing
- 4eb07e046 do not run build when prerelease is already selected
- 961f420de defer prerelease tagging until staging is complete
- 08040f9ad actions testing
- 4b416ccf6 (main) use revision instead of version for module dependency
- e7959e5bb Merge branch 'main' of github.com:nosqlbench/nosqlbench
- 362e3c6cd (origin/main) Merge pull request #942 from nosqlbench/nosqlbench-937
- 839e4d16b Merge pull request #943 from nosqlbench/nosqlbench-941-annotators
- 0c833f99c (origin/nosqlbench-941-annotators, nosqlbench-941-annotators) PR fixes from comments
- 696576a31 Merge branch 'main' of github.com:nosqlbench/nosqlbench
- 626cc87dd Merge pull request #939 from nosqlbench/snyk-upgrade-710e67120f57fae3c6a15ef21b17d531
- a886ff2f8 restore grafana annotator
- 494f20f5a Revert "remove engine-clients module"
- 69be6a106 (origin/nosqlbench-937, nosqlbench-937) make tests use workload instead of yaml
- 87074249c fix: upgrade org.apache.pulsar:pulsar-client from 2.10.3 to 2.11.0
- 0c9091714 merge fixups
- 90bcecc68 apply superset config checking
- dbf3df1e3 make op synthesis even more defensive
- afaa6f5b9 remove duplicitous synonym logic
- 71f2207c9 remove unused method
- 3e66317fc make stdout op synthesis defensive
- 2b521edbb provide an empty value type for op templates
- f63c7aead replace CI+CD friendly revision
- a85c38f15 restore tag filtering diagnostics
- 4175e7954 improve logging levels for debugging
- 6c0d60706 avoid NPE for empty op list
- 8cf81b38e simply TagFilter for logging
- 7af268003 Merge pull request #928 from nosqlbench/jeffb/coverage-pipeline
- 5d128fcfa Removed redundant step part of install activity
- 5a436e9fd Merge pull request #936 from nosqlbench/snyk-fix-b62f56ee579675482f5021801d076678
- b7f11c44a Merge pull request #931 from nosqlbench/nosqlbench-930-errormsg
- 5d0460302 Merge pull request #933 from nosqlbench/readme-update
- 99fb2a9af fix: adapter-dynamodb/pom.xml to reduce vulnerabilities
- ac4dbbcd3 (origin/readme-update, readme-update) Merge branch 'main' into readme-update
- 8276bab47 Merge pull request #929 from nosqlbench/doc-fixups
- 7d0a9a9b4 readme update
- 591454912 (origin/nosqlbench-930-errormsg, nosqlbench-930-errormsg) replace missing cancelation for shutdown hook
- 7e5d7f188 (origin/doc-fixups, doc-fixups) disable incomplete apps
- 2847543aa update app docs
- 1ea5c8a1e set weight levels and ranges for exported markdown
- fe4c25898 cleanup and document virtdata bundled app
- fa88a3b13 simplify fenced code blocks for compatibility
- 27270ebd1 (origin/jeffb/coverage-pipeline) Order of activities to solve coverage report
- 3cd4a42e6 Merge pull request #927 from nosqlbench/snyk-upgrade-fa24252251d9c2ec2647704da5f13b2e
- aee8420b4 Merge branch 'main' into snyk-upgrade-fa24252251d9c2ec2647704da5f13b2e
- de8f4785b Merge pull request #926 from nosqlbench/snyk-upgrade-88adcf287a14846f1dc037e1f25e78c0
- 502983d9c Merge pull request #925 from nosqlbench/snyk-upgrade-c91321671f34fccf8aef9f8c17ece9af
- 2afaacfea Merge pull request #924 from nosqlbench/snyk-upgrade-bd470377c4ae812231a8ad877e376818
- b95dd84d2 Merge pull request #923 from nosqlbench/snyk-upgrade-9f0ab1f92e4a5eb3ffb74cef818f055e
- 3f54bc98b Merge pull request #922 from nosqlbench/snyk-upgrade-376a3df37f912826e882e419edea0b60
- 42b9ccfca Merge pull request #921 from nosqlbench/snyk-upgrade-35879a4420d25f8c65222bd05ce77615
- 18bfe6274 Merge pull request #920 from nosqlbench/jeffb/test-fail-fix
- f708fc262 Debugging and resource cleanup.
- 218eb5f44 fix: upgrade org.apache.pulsar:pulsar-client-admin from 2.10.1 to 2.10.3
- dd4f639e7 fix: upgrade org.codehaus.groovy:groovy from 3.0.13 to 3.0.14
- 5cd46f3fd fix: upgrade org.graalvm.tools:profiler from 22.2.0 to 22.3.0
- ab681f7ce fix: upgrade org.graalvm.js:js-scriptengine from 22.2.0 to 22.3.0
- 44c79fc36 fix: upgrade org.graalvm.js:js from 22.2.0 to 22.3.0
- d85d8b7c0 fix: upgrade org.apache.pulsar:pulsar-client from 2.10.1 to 2.10.2
- e5830a3a5 fix: upgrade org.graalvm.sdk:graal-sdk from 22.2.0 to 22.3.0
- c61fac244 Reactivate coverage; thread timing for test
- 28a3ac3ad Added waits for testing

View File

@ -19,4 +19,4 @@ set -e
export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
export PRERELEASE_REVISION=$(echo "${REVISION}" | cut -d'-' -f1)
printf "%s-prerelease\n" "${PRERELEASE_REVISION}"
printf "%s-preview\n" "${PRERELEASE_REVISION}"

22
scripts/get-release-version.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
#
# Copyright (c) 2023 nosqlbench
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
export PRERELEASE_REVISION=$(echo "${REVISION}" | cut -d'-' -f1)
printf "%s\n" "${PRERELEASE_REVISION}"