2023-01-23 22:02:40 -06:00
|
|
|
name: preview
|
2020-03-04 11:26:22 -06:00
|
|
|
|
2023-01-23 20:04:45 -06:00
|
|
|
# This workflow should run for any push which is a preview build.
|
|
|
|
# Preview builds are indicated with changes to PREVIEW_NOTES.md.
|
|
|
|
# In order to effect this, you can do the following:
|
|
|
|
# scripts/release-notes.sh > PREVIEW_NOTES.md
|
|
|
|
|
2020-03-04 11:26:22 -06:00
|
|
|
on:
|
|
|
|
push:
|
2023-01-23 21:18:53 -06:00
|
|
|
tags:
|
2023-01-23 21:43:50 -06:00
|
|
|
- "[0-9]+.[0-9]+.[0-9]+-preview"
|
2020-03-04 11:26:22 -06:00
|
|
|
|
|
|
|
jobs:
|
2023-01-23 22:02:40 -06:00
|
|
|
preview-build:
|
2022-08-16 10:13:01 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-03-04 11:26:22 -06:00
|
|
|
steps:
|
2020-08-10 05:59:25 -05:00
|
|
|
|
2020-12-07 14:34:01 -06:00
|
|
|
- name: checkout repo
|
2022-07-22 11:33:43 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-12-07 14:34:01 -06:00
|
|
|
|
|
|
|
- name: setup java
|
2022-07-22 11:33:43 -05:00
|
|
|
uses: actions/setup-java@v3
|
2020-12-07 14:34:01 -06:00
|
|
|
with:
|
2022-07-22 11:33:43 -05:00
|
|
|
distribution: 'temurin'
|
2021-12-21 17:00:55 -06:00
|
|
|
java-version: '17'
|
2020-12-07 14:34:01 -06:00
|
|
|
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
|
2021-04-21 11:49:51 -05:00
|
|
|
uses: actions/cache@v2
|
2020-12-07 14:34:01 -06:00
|
|
|
with:
|
|
|
|
path: ~/.m2
|
|
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-m2
|
|
|
|
|
|
|
|
- name: read versions
|
|
|
|
run: |
|
|
|
|
set -x
|
2023-01-23 18:59:22 -06:00
|
|
|
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
|
2023-01-23 15:14:27 -06:00
|
|
|
|
2023-01-23 18:59:22 -06:00
|
|
|
- name: build preview revision
|
2023-01-23 15:14:27 -06:00
|
|
|
run: |
|
2023-01-23 18:59:22 -06:00
|
|
|
mvn clean package -Drevision="${{ env.PREVIEW_VERSION }}"
|
2022-08-18 16:20:48 -05:00
|
|
|
|
2020-12-07 20:30:50 -06:00
|
|
|
- name: Setup docker buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: docker hub login
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: docker test build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: Dockerfile
|
|
|
|
pull: true
|
|
|
|
push: false
|
|
|
|
load: true
|
|
|
|
tags: ${{ env.DOCKER_TAGS }}
|
|
|
|
|
|
|
|
- name: sanity check docker image
|
|
|
|
run: |
|
2023-01-23 18:59:22 -06:00
|
|
|
docker run --rm nosqlbench/nosqlbench:${{ env.PREVIEW_VERSION }} --version
|
2020-12-07 20:30:50 -06:00
|
|
|
|
2020-12-07 14:34:01 -06:00
|
|
|
- name: bundle artifacts
|
|
|
|
run: |
|
|
|
|
pwd
|
|
|
|
ls -l
|
|
|
|
mkdir staging
|
2022-07-01 10:46:05 -05:00
|
|
|
cp nb5/target/nb5.jar nb5/target/nb5 staging
|
2020-12-07 14:34:01 -06:00
|
|
|
|
|
|
|
- name: upload artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: binaries
|
|
|
|
path: staging
|
|
|
|
|
2023-01-23 17:57:32 -06:00
|
|
|
# - 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
|
2022-08-18 16:20:48 -05:00
|
|
|
|
2023-01-23 15:19:09 -06:00
|
|
|
- name: prepare release summary
|
|
|
|
id: prepare_summary
|
|
|
|
run: |
|
|
|
|
#summary=$(scripts/release-notes.sh)
|
2023-01-25 20:19:54 -06:00
|
|
|
summary=$(cat PREVIEW_NOTES.md)
|
2023-01-23 15:19:09 -06:00
|
|
|
summary="${summary//'%'/'%25'}"
|
|
|
|
summary="${summary//$'\n'/'%0A'}"
|
|
|
|
summary="${summary//$'\r'/'%0D'}"
|
2023-01-23 17:57:32 -06:00
|
|
|
echo "release_summary=$summary" >> $GITHUB_STATE
|
2023-01-23 15:19:09 -06:00
|
|
|
|
2023-01-23 19:57:48 -06:00
|
|
|
- name: bump minor version
|
|
|
|
run: |
|
|
|
|
scripts/bump-minor-version
|
|
|
|
|
2020-12-07 20:30:50 -06:00
|
|
|
- name: docker push to hub
|
2020-12-07 14:34:01 -06:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-09-29 13:10:35 -05:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2020-12-07 14:34:01 -06:00
|
|
|
file: Dockerfile
|
|
|
|
pull: true
|
|
|
|
push: true
|
|
|
|
tags: ${{ env.DOCKER_TAGS }}
|
|
|
|
|
2023-01-25 21:17:57 -06:00
|
|
|
- name: update github release
|
|
|
|
id: update_github_release
|
2023-01-25 21:21:37 -06:00
|
|
|
uses: johnwbyrd/update-release@v1.0.0
|
2020-12-07 14:34:01 -06:00
|
|
|
with:
|
2023-01-25 21:17:57 -06:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-25 21:20:00 -06:00
|
|
|
files: nb5/target/nb5 nb5/target/nb5.jar
|
2023-01-25 21:17:57 -06:00
|
|
|
release: Preview Release ${{ env.PREVIEW_VERSION }}
|
2023-01-25 21:36:49 -06:00
|
|
|
tag: nb5-${{ env.PREVIEW_VERSION }}
|
2023-01-25 21:17:57 -06:00
|
|
|
message: preview release ${{ env.PREVIEW_VERSION }}
|
2020-12-07 14:34:01 -06:00
|
|
|
body: ${{ steps.prepare_summary.outputs.release_summary }}
|
|
|
|
|
2023-01-25 21:17:57 -06:00
|
|
|
# - 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
|
|
|
|
#
|
2022-09-30 10:47:43 -05:00
|
|
|
- name: Archive Test Results
|
|
|
|
if: always()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: test-results
|
|
|
|
path: |
|
|
|
|
[a-zA-Z]**/logs/*
|
|
|
|
|
2023-01-23 17:57:32 -06:00
|
|
|
# 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
|
|
|
|
#
|
|
|
|
#
|
2021-12-09 14:24:21 -06:00
|
|
|
# docs:
|
|
|
|
# needs: release
|
2022-08-16 10:13:01 -05:00
|
|
|
# runs-on: ubuntu-20.04
|
2021-12-09 14:24:21 -06:00
|
|
|
# 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
|
|
|
|
#
|
2021-12-01 13:16:06 -06:00
|
|
|
# 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
|
2020-03-26 13:08:04 -05:00
|
|
|
|
2020-05-05 20:53:24 -05:00
|
|
|
|
|
|
|
|