Skip to content

Commit 56ddcde

Browse files
Make latest changelog appear on top (#249)
- Also remove changelog from README.md. An example release PR (#251) Sample release (https://github.com/databricks/databricks-vscode/releases/tag/untagged-0bf4343e164a51d07cdd)
1 parent 387a423 commit 56ddcde

File tree

6 files changed

+34
-35
lines changed

6 files changed

+34
-35
lines changed

.github/workflows/create-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- run: |
2929
TITLE=$(git show -s --format=%B HEAD | head -n1)
3030
CHANGELOG_FILE=packages/databricks-vscode/CHANGELOG.md
31-
RELEASE_VERSION=$(cat $CHANGELOG_FILE | grep -E "^# Release: v(([0-9]+\.){2}[0-9]+).*" | tail -n1 | sed -nr 's/.*Release: v(([0-9]+\.){2}[0-9]+).*/\1/p')
31+
RELEASE_VERSION=$(cat $CHANGELOG_FILE | grep -E "^# Release: v(([0-9]+\.){2}[0-9]+).*" | head -n1 | sed -nr 's/.*Release: v(([0-9]+\.){2}[0-9]+).*/\1/p')
3232
3333
tmpfile=$(mktemp /tmp/commit-message.XXXXX)
34-
cat $CHANGELOG_FILE | awk 'BEGIN{C=0} $0 ~ /^# Release: v'"$RELEASE_VERSION"'.*/{C=1} C!=0 {print $0}' > $tmpfile
34+
cat $CHANGELOG_FILE | awk 'BEGIN{C=0} $0 ~ /^# Release: v.*/ && C==1{C=2} $0 ~ /^# Release: v'"$RELEASE_VERSION"'.*/{C=1} C==1 {print $0}' > $tmpfile
3535
cat $tmpfile >> $GITHUB_STEP_SUMMARY
3636
gh release create release-v$RELEASE_VERSION ${{ steps.download.outputs.download-path }}/databricks*/*.vsix \
3737
-d --target main -t "$TITLE" -F $tmpfile
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Release: v0.0.2
1+
# Release: v0.0.3
22

33
## packages/databricks-sdk-js
44

5-
## <small>0.0.2 (2022-11-15)</small>
5+
## <small>0.0.3 (2022-11-21)</small>
66

7-
- First release
7+
- Fix repo list pagination
88

9-
# Release: v0.0.3
9+
# Release: v0.0.2
1010

1111
## packages/databricks-sdk-js
1212

13-
## <small>0.0.3 (2022-11-21)</small>
13+
## <small>0.0.2 (2022-11-15)</small>
1414

15-
- Fix repo list pagination
15+
- First release
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Release: v0.0.2
1+
# Release: v0.0.3
22

33
## packages/databricks-vscode-types
44

5-
## <small>0.0.2 (2022-11-15)</small>
6-
7-
- First release
5+
## <small>0.0.3 (2022-11-21)</small>
86

9-
# Release: v0.0.3
7+
# Release: v0.0.2
108

119
## packages/databricks-vscode-types
1210

13-
## <small>0.0.3 (2022-11-21)</small>
11+
## <small>0.0.2 (2022-11-15)</small>
12+
13+
- First release
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# Release: v0.0.2
2-
3-
## packages/databricks-vscode
4-
5-
## <small>0.0.2 (2022-11-15)</small>
6-
7-
- First private preview release
8-
91
# Release: v0.0.3
102

113
## packages/databricks-vscode
@@ -18,3 +10,11 @@
1810
- Improve handling cases where the user doesn't hve administrator permissions in the Databricks workspace
1911
- Show warning when the name of the selected Databricks Repo doesn't match the local workspace name
2012
- Add setting `databricks.bricks.verboseMode` to show debug logs for the sync command
13+
14+
# Release: v0.0.2
15+
16+
## packages/databricks-vscode
17+
18+
## <small>0.0.2 (2022-11-15)</small>
19+
20+
- First private preview release

packages/databricks-vscode/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,4 @@ Comment out until the repo is public so the image can be loaded by the marketpla
4141
- The [User Guide](https://docs.databricks.com/dev-tools/vscode-ext.html)
4242
contains comprehesive documentation about the Databricks extension.
4343

44-
## Release Notes
45-
46-
### 0.0.1
47-
48-
Preview version of the VS Code extension for Databricks
49-
5044
**Happy Coding!**

scripts/generate_changelog.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ git tag -l --sort=-committerdate
22
TAG=$(git tag -l --sort=-committerdate | grep -E "release-v(([0-9]+\.){2}[0-9]+)" | head -n1)
33

44
for PACKAGE in "packages/databricks-vscode" "packages/databricks-sdk-js" "packages/databricks-vscode-types"; do
5-
tmpfile=$(mktemp /tmp/generate_changelog.XXXXXX)
6-
echo "## $PACKAGE" >> $tmpfile
5+
latestChangelog=$(mktemp /tmp/generate_changelog.XXXXXX)
6+
echo "## $PACKAGE" >> $latestChangelog
77

88
if [[ $TAG ]]; then
99
echo "Release tag found. Generating changelog from $TAG"
10-
yarn conventional-changelog --tag-prefix="release-v" -k $PACKAGE --commit-path $PACKAGE >> $tmpfile
10+
yarn conventional-changelog --tag-prefix="release-v" -k $PACKAGE --commit-path $PACKAGE >> $latestChangelog
1111
else
1212
echo "No release tag matching pattern 'release-v*' found. Generating changelog from begining"
13-
yarn conventional-changelog -k $PACKAGE --commit-path $PACKAGE >> $tmpfile
13+
yarn conventional-changelog -k $PACKAGE --commit-path $PACKAGE >> $latestChangelog
1414
fi
1515

16-
cat $tmpfile | grep -Ev "Release: v.+" >> $2
17-
echo "# Release: v$1" >> $PACKAGE/CHANGELOG.md
18-
cat $tmpfile | grep -Ev "Release: v.+" >> $PACKAGE/CHANGELOG.md
16+
cat $latestChangelog | grep -Ev "Release: v.+" >> $2
17+
18+
tmpfile=$(mktemp /tmp/generate_changelog.XXXXXX)
19+
echo "# Release: v$1" >> $tmpfile
20+
cat $latestChangelog | grep -Ev "Release: v.+" >> $tmpfile
21+
cat $PACKAGE/CHANGELOG.md >> $tmpfile
22+
23+
cat $tmpfile > $PACKAGE/CHANGELOG.md
1924
done

0 commit comments

Comments
 (0)