From 8cce0173ff30bb1a0dc8fa9a7ffdad834a9f504c Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Mon, 7 Dec 2020 13:41:12 -0600 Subject: [PATCH] backport auto pre-release on -rc branches --- .github/workflows/release.yml | 49 ++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8757d8361..fdad4a3d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-18.04 steps: - - name: checkout repo + - name: checkout repo uses: actions/checkout@v2 - name: setup java @@ -87,7 +87,8 @@ jobs: - name: prepare release run: scripts/release-prepare.sh env: - RELEASE_BRANCH_NAME: "main" + RELEASE_BRANCH_NAME: "main" + PRERELEASE_BRANCH_PATTERN: "-rc" GIT_RELEASE_BOT_NAME: "nb-droid" GIT_RELEASE_BOT_EMAIL: ${{ secrets.GIT_RELEASE_BOT_EMAIL }} ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }} @@ -103,7 +104,7 @@ jobs: - name: bundle integration test logs run: | pwd - ls -l + find nb mkdir -p itlogs/nb cp -R nb/logs itlogs/nb @@ -138,22 +139,34 @@ jobs: mkdir staging cp nb/target/nb.jar nb/target/nb staging - - name: upload artifacts - uses: actions/upload-artifact@v1 - with: - name: binaries - path: staging + - name: upload artifacts + uses: actions/upload-artifact@v1 + with: + name: binaries + path: staging - - name: docker push - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: nosqlbench/nosqlbench - tags: latest, ${{ env.RELEASE_VERSION }} - tag_with_ref: false + - name: select release type from branch name + run: | + current_branch=$(git rev-parse --abbrev-ref HEAD) + if [[ ${current_branch} == *"-rc"* ]] + then + echo "PRERELEASE=true" >> $GITHUB_ENV + echo "DOCKER_TAGS='"${{ env.RELEASE_VERSION }}"'" >> $GITHUB_ENV + else + echo "PRERELEASE=false" >> $GITHUB_ENV + echo "DOCKER_TAGS='latest,"${{ env.RELEASE_VERSION }}"'" >> $GITHUB_ENV + fi - - name: bundle guidebook + - name: docker push + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: nosqlbench/nosqlbench + tags: ${{ env.DOCKER_TAGS }} + tag_with_ref: false + + - name: bundle guidebook run: mkdir guidebook && cp -R nb/target/guidebook guidebook - name: upload guidebook @@ -171,7 +184,7 @@ jobs: tag_name: ${{ env.RELEASE_TAGNAME }} release_name: Release ${{ env.RELEASE_TAGNAME }} draft: false - prerelease: false + prerelease: ${{ env.PRERELEASE }} body: ${{ steps.prepare_summary.outputs.release_summary }} - name: upload nb.jar