Files
nosqlbench/.github/workflows/release.yml
T
dependabot[bot] 077f46af46 build(deps): bump actions/setup-java from 6.0.0 to 6.0.1
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v6.0.0...v6.0.1)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-01 12:36:11 +00:00

271 lines
8.7 KiB
YAML

name: release
# 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/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 <tag>,
# although this should never be done!
# The build logic should only build what is necessary, but presently 'preview'
# and 'release' do extra work. This needs to be improved.
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+-release"
jobs:
release-build:
runs-on: ubuntu-22.04
outputs:
release_version: ${{ steps.versions.outputs.RELEASE_VERSION }}
release_version_numeric: ${{ steps.versions.outputs.RELEASE_VERSION_NUMERIC }}
docker_tags: ${{ steps.versions.outputs.DOCKER_TAGS }}
steps:
- name: checkout repo
uses: actions/checkout@v7
- name: setup java
uses: actions/setup-java@v6.0.1
with:
distribution: 'oracle'
java-version: '25'
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
if [ -n "$(docker image ls -aq)" ]; then docker rmi $(docker image ls -aq); fi
df -h
- name: install fuse2
run: sudo apt install libfuse2
- name: install desktop-file-utils
run: sudo apt install desktop-file-utils
- name: Cache Maven packages
uses: actions/cache@v6
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: read versions
id: versions
run: |
set -x
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 "RELEASE_VERSION_NUMERIC=${RELEASE_VERSION_NUMERIC}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_VERSION_NUMERIC},nosqlbench/nosqlbench:${RELEASE_VERSION_SHORT}-latest,nosqlbench/nosqlbench:latest" >> $GITHUB_ENV
- name: build release revision
run: |
mvn clean package -Drevision="${{ env.RELEASE_VERSION }}"
- name: Setup docker buildx
uses: docker/setup-buildx-action@v4
- name: docker hub login
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker test build
uses: docker/build-push-action@v7
with:
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.RELEASE_VERSION_NUMERIC }} --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@v7
with:
name: binaries
path: staging
- name: generate javadoc
run: mvn javadoc:aggregate-jar
continue-on-error: false
- name: upload javadoc
uses: actions/upload-artifact@v7
with:
name: javadocs
path: target/nosqlbench-*-javadoc.jar
- name: bump minor version
run: |
scripts/bump-minor-version
- name: docker push to hub
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
pull: true
push: true
tags: ${{ env.DOCKER_TAGS }}
# https://github.com/softprops/action-gh-release
- name: create github release
uses: softprops/action-gh-release@v3.0.3
if: startsWith(github.ref, 'refs/tags/')
with:
# body: ${{ steps.prepare_summary.outputs.release_summary }}
# body_path: PREVIEW_NOTES.md
draft: false
prerelease: true
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: 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@v7
with:
name: test-results
path: |
[a-zA-Z]**/logs/*
# release-docs:
# needs: release-build
# runs-on: ubuntu-22.04
# steps:
# - name: import env vars
# run: |
# echo "RELEASE_VERSION=${{ needs.release-build.outputs.release_version }}" >> $GITHUB_ENV
# echo "DOCKER_TAGS=${{ needs.release-build.outputs.docker_tags }}" >> $GITHUB_ENV
#
# - name: checkout build docs
# uses: actions/checkout@v7
# with:
# repository: nosqlbench/nosqlbench-build-docs
# path: build-docs
#
# - name: download exported_docs
# uses: actions/download-artifact@v4
# with:
# name: exported-docs
# path: build-docs
#
# - name: overlay docs changes and push
# run: |
# set -x
# cd build-docs
# ./doimport.sh
# rm exported_docs.zip
# git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
# git config --global user.name "${{ secrets.NBDROID_NAME }}"
# git add .
# git tag -f ${{ env.RELEASE_VERSION }}
# git commit -m"docs update for ${{ env.RELEASE_VERSION }}"
# git push
#
# javadocs:
# needs: release-docs
# runs-on: ubuntu-22.04
# steps:
#
# - name: import env vars
# run: |
# echo "RELEASE_VERSION=${{ needs.release-build.outputs.release_version }}" >> $GITHUB_ENV
# echo "DOCKER_TAGS=${{ needs.release-build.outputs.docker_tags }}" >> $GITHUB_ENV
#
# - name: checkout javadocs
# uses: actions/checkout@v7
# with:
# repository: nosqlbench/nosqlbench-javadocs
# path: javadocs
#
# - name: download javadocs
# uses: actions/download-artifact@v4
# with:
# name: javadocs
# path: javadocs
#
# - name: overlay javadocs changes and push
# run: |
# set -x
# git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
# git config --global user.name "${{ secrets.NBDROID_NAME }}"
# cd javadocs
# ./refresh.sh release
# git add .
# CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
# echo "found $CHANGES to push for javadocs updates"
# if (( $CHANGES > 0 ))
# then
# git commit -m"javadocs update for ${{ env.RELEASE_VERSION }}"
# git push
# fi