Skip to content

Commit

Permalink
fix: Always Use Latest for Release Notes (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanbrub authored Oct 10, 2024
1 parent 27b8167 commit cd00385
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 28 deletions.
22 changes: 3 additions & 19 deletions .github/scripts/make-release-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,17 @@ set -o nounset
# working directory. Also, make a release-notes.md files compared between the given
# release commit and previous version

if [[ $# != 4 ]]; then
echo "$0: Missing release version, release commit, previous version, or distro source argument"
if [[ $# != 2 ]]; then
echo "$0: Missing release version or distro source argument"
exit 1
fi

RELEASE_VERSION=$1
RELEASE_COMMIT=$2
PREVIOUS_VERSION=$3
DISTRO_SOURCE=$4
RELEASE_TAG="v${RELEASE_VERSION}"
PREVIOUS_TAG="v${PREVIOUS_VERSION}"
DISTRO_SOURCE=$2
ARTIFACT=deephaven-benchmark-${RELEASE_VERSION}
DISTRO_DEST=target/distro
THIS=$(basename "$0")
RELEASE_NOTES=target/release-notes.md
WORKING_DIR=$(pwd)

PREVIOUS_REF=${PREVIOUS_TAG}
if [[ ${PREVIOUS_VERSION} != *"."*"."* ]]; then
PREVIOUS_REF=${PREVIOUS_VERSION}
fi

# Make the Release Notes File
echo "**What's Changed**" > ${RELEASE_NOTES}
git log --oneline ${PREVIOUS_REF}...${RELEASE_COMMIT} | sed -e 's/^/- /' >> ${RELEASE_NOTES}
echo "**Full Changelog**: https://github.com/deephaven/benchmark/compare/${PREVIOUS_TAG}...${RELEASE_TAG}" >> ${RELEASE_NOTES}

# Generate dependencies directory
mkdir -p ${DISTRO_DEST}/libs/
cd ${DISTRO_DEST}
Expand Down
33 changes: 33 additions & 0 deletions .github/scripts/make-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

# Copyright (c) 2024-2024 Deephaven Data Labs and Patent Pending

# Generate release notes for the given tags/commits and make a release-notes.md
# file in the working directory

if [[ $# != 3 ]]; then
echo "$0: Missing release version, release commit or previous version argument"
exit 1
fi

RELEASE_VERSION=$1
RELEASE_COMMIT=$2
PREVIOUS_VERSION=$3
RELEASE_TAG="v${RELEASE_VERSION}"
PREVIOUS_TAG="v${PREVIOUS_VERSION}"
RELEASE_NOTES=release-notes.md

PREVIOUS_REF=${PREVIOUS_TAG}
if [[ ${PREVIOUS_VERSION} != *"."*"."* ]]; then
PREVIOUS_REF=${PREVIOUS_VERSION}
fi

# Make the Release Notes File
echo "**What's Changed**" > ${RELEASE_NOTES}
git log --oneline ${PREVIOUS_REF}...${RELEASE_COMMIT} | sed -e 's/^/- /' >> ${RELEASE_NOTES}
echo "**Full Changelog**: https://github.com/deephaven/benchmark/compare/${PREVIOUS_TAG}...${RELEASE_TAG}" >> ${RELEASE_NOTES}

23 changes: 14 additions & 9 deletions .github/workflows/publish-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
VERSION: "${{inputs.version}}"
COMMIT: "${{inputs.release-commit}}"
PREV_VERSION: "${{inputs.previous-version}}"
LATEST_DIR: ${{github.workspace}}/latest
LATEST_DIR: ${{github.workspace}}
RELEASE_DIR: ${{github.workspace}}/release

permissions:
Expand All @@ -54,7 +54,8 @@ jobs:
- name: Checkout Latest
uses: actions/checkout@v4
with:
path: latest
fetch-depth: 0
fetch-tags: true

- name: Checkout Release
uses: actions/checkout@v4
Expand All @@ -79,24 +80,28 @@ jobs:
mvn -B install --file pom.xml
docker compose down
- name: Build Release Distro and Notes
- name: Build Release Distribution
working-directory: ${{env.RELEASE_DIR}}
run: ${LATEST_DIR}/.github/scripts/make-release-distro.sh ${VERSION} ${COMMIT} ${PREV_VERSION} ${LATEST_DIR}/.github/distro
run: ${LATEST_DIR}/.github/scripts/make-release-distro.sh ${VERSION} ${LATEST_DIR}/.github/distro

- name: Test Release Distro
working-directory: ${{env.RELEASE_DIR}}
run: |
${LATEST_DIR}/.github/scripts/test-release-distro.sh ${VERSION}
ls -l ${RELEASE_DIR}/target/
mv target/deephaven-benchmark-${VERSION}.tar ${LATEST_DIR}/
mv target/deephaven-benchmark-${VERSION}-results.tar ${LATEST_DIR}/
- name: Make Release Notes
run: .github/scripts/make-release-notes.sh ${VERSION} ${COMMIT} ${PREV_VERSION}

- name: Archive Results
uses: actions/upload-artifact@v4
with:
name: Deephaven Benchmark Release
path: |
${{env.RELEASE_DIR}}/target/deephaven-benchmark-${{env.VERSION}}.tar
${{env.RELEASE_DIR}}/target/deephaven-benchmark-${{env.VERSION}}-results.tar
${{env.RELEASE_DIR}}/target/release-notes.md
deephaven-benchmark-${{env.VERSION}}.tar
deephaven-benchmark-${{env.VERSION}}-results.tar
release-notes.md
- name: Publish Github Release
if: ${{ github.ref_name == 'main' }}
Expand All @@ -107,6 +112,6 @@ jobs:
makeLatest: ${{inputs.mark-latest}}
allowUpdates: true
artifacts: "${{env.RELEASE_DIR}}/target/deephaven-benchmark-${{env.VERSION}}.tar"
bodyFile: "${{env.RELEASE_DIR}}/target/release-notes.md"
bodyFile: release-notes.md"


1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>standalone</shadedClassifierName>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
Expand Down

0 comments on commit cd00385

Please sign in to comment.