nosqlbench/.github/workflows/prerelease.yml

283 lines
8.1 KiB
YAML
Raw Normal View History

2023-01-23 15:31:52 -06:00
name: prerelease
2020-03-04 11:26:22 -06:00
on:
push:
2021-10-05 14:40:40 -05:00
branches:
2023-01-19 16:53:33 -06:00
- prerelease-testing
2020-05-05 20:53:24 -05:00
paths:
- RELEASENOTES.**
2020-03-04 11:26:22 -06:00
jobs:
2020-03-10 18:44:59 -05:00
release:
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
uses: actions/checkout@v3
2020-12-07 14:34:01 -06:00
- name: setup java
uses: actions/setup-java@v3
2020-12-07 14:34:01 -06:00
with:
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
2023-01-23 15:14:27 -06:00
# - name: avoid release loop
# run: scripts/avoid-release-loop.sh
# env:
# GIT_RELEASE_BOT_NAME: "nb-droid"
#
# - name: capture tty for gpg
# run: |
# echo "TTY="$(tty) >> $GITHUB_ENV
# echo "GPG_TTY="$(tty) >> $GITHUB_ENV
# # echo "::set-env name=TTY::"$(tty)
# # echo "::set-env name=GPG_TTY::"$(tty)
#
# - name: initialize gpg
# run: |
# set -x
# echo "${{ secrets.GITHUB_GPG_KEY }}" | base64 -d > private.key
# gpg --import --batch ./private.key
# rm ./private.key
# echo "gnupg files:"
# ls -l ~/.gnupg/
#
2020-12-07 14:34:01 -06:00
- 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 15:33:34 -06:00
PRERELEASE_REVISION=$(scripts/get-prerelease-version.sh)
2023-01-23 15:31:52 -06:00
echo "PRERELEASE_REVISION=${PRERELEASE_REVISION}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:latest-prerelease,nosqlbench/nosqlbench:${PRERELEASE_VERSION}-prerelease" >> $GITHUB_ENV
2023-01-23 15:14:27 -06:00
2020-12-07 20:30:50 -06:00
2023-01-23 15:14:27 -06:00
- name: build prerelease revision
run: |
mvn package -Drevision="${{ env.PRERELEASE_REVISION }}"
2020-12-07 14:34:01 -06:00
2022-08-18 16:20:48 -05:00
- name: generate javadoc
run: mvn javadoc:aggregate-jar
continue-on-error: false
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: |
docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }} --version
2021-12-09 15:15:32 -06:00
# - name: bundle integration test logs
# run: |
# pwd
# find nb
# mkdir -p itlogs/nb
# cp -R nb/logs itlogs/nb
#
# - name: upload integration test logs
# uses: actions/upload-artifact@v1
# with:
# name: itlogs
# path: itlogs
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
2022-08-18 16:20:48 -05:00
- run: ls -la target
- 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 "::set-output name=release_summary::$summary"
- name: tag prerelease
run: |
git tag ${{ env.PRERELEASE_REVISION }}
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 }}
2020-12-07 20:30:50 -06:00
- name: create github release
id: create_github_release
2020-12-07 14:34:01 -06:00
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2023-01-23 15:14:27 -06:00
tag_name: ${{ env.PRERELEASE_REVISION }}
release_name: Release ${{ env.PRERELEASE_REVISION }}
2020-12-07 14:34:01 -06:00
draft: false
2023-01-23 15:14:27 -06:00
prerelease: true
2020-12-07 14:34:01 -06:00
body: ${{ steps.prepare_summary.outputs.release_summary }}
2020-12-07 20:30:50 -06:00
- name: upload nb.jar to github release
2020-12-07 14:34:01 -06:00
id: upload-nb-jar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2020-12-07 20:30:50 -06:00
upload_url: ${{ steps.create_github_release.outputs.upload_url }}
2022-07-01 10:46:05 -05:00
asset_path: nb5/target/nb5.jar
asset_name: nb5.jar
2020-12-07 14:34:01 -06:00
asset_content_type: application/octet-stream
2020-12-07 20:30:50 -06:00
- name: upload nb binary to github release
2020-12-07 14:34:01 -06:00
id: upload-nb-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2020-12-07 20:30:50 -06:00
upload_url: ${{ steps.create_github_release.outputs.upload_url }}
2022-07-01 10:46:05 -05:00
asset_path: nb5/target/nb5
asset_name: nb5
2020-12-07 14:34:01 -06:00
asset_content_type: application/octet-stream
2020-03-19 13:13:17 -05:00
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/*
2022-08-18 16:20:48 -05: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
2022-09-30 10:47:43 -05:00
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
#
# 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-05-05 20:53:24 -05:00