Skip to content

Commit 4a6c4be

Browse files
create pr
1 parent d536123 commit 4a6c4be

4 files changed

Lines changed: 40 additions & 41 deletions

File tree

.github/workflows/release-pr.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ on:
44
workflow_dispatch:
55
pull_request:
66
branch: [main]
7+
push:
8+
branch: [main]
79

810
jobs:
911
generate-changelog:
1012
runs-on: "macos-latest"
1113
strategy:
1214
matrix:
13-
package:
14-
[
15-
packages/databricks-vscode,
16-
packages/databricks-sdk,
17-
packages/databricks-vscode-types,
18-
".",
19-
]
2015
node-version: [16.x]
2116
steps:
2217
- uses: actions/checkout@v3
@@ -31,22 +26,27 @@ jobs:
3126

3227
- run: yarn install --immutable
3328

34-
- name: Changelog for ${{ matrix.package }}
35-
run: bash scripts/generate_changelog.sh ${{ matrix.package }} $GITHUB_STEP_SUMMARY
36-
37-
version-check:
38-
name: Version Check
39-
runs-on: "macos-latest"
40-
steps:
41-
- uses: actions/checkout@v3
42-
with:
43-
fetch-depth: 0
44-
45-
- name: Use Node.js ${{ matrix.node-version }}
46-
uses: actions/setup-node@v3
47-
with:
48-
node-version: ${{ matrix.node-version }}
49-
cache: "yarn"
50-
51-
- run: yarn install --immutable
52-
- run: yarn version check
29+
- name: Changelog
30+
id: create-changelog
31+
run: |
32+
bash scripts/generate_changelog.sh $PACKAGE tmpfile
33+
cat tmpfile >> $GITHUB_STEP_SUMMARY
34+
cat tmpfile >> CHANGELOG.md
35+
echo "changelog_file=tempfile" >> $GITHUB_OUTPUT
36+
37+
- name: Create Branch
38+
id: create-branch
39+
run: |
40+
COMMIT_SHA=$(git rev-parse --short HEAD)
41+
git checkout -b releases/draft-$COMMIT_SHA
42+
git add CHANGELOG.md
43+
git commit -S -m "Changelog"
44+
git push origin HEAD
45+
echo "branch_name=releases/draft-$COMMIT_SHA" >> $GITHUB_OUTPUT
46+
47+
- name: Create PR
48+
run: |
49+
gh pr create -B main -H ${{ steps.create-branch.outputs.branch_name }} \
50+
--title "Release:ENTER_RELEASE_VERSION" \
51+
--body-file ${{ steps.create-changelog.outputs.changelog_file }}
52+
rm ${{ steps.create-changelog.outputs.changelog_file }}

.yarn/versions/1c2242bd.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
releases:
2-
"@databricks/databricks-sdk": patch
3-
"@databricks/databricks-vscode": patch
4-
51
declined:
2+
- "@databricks/databricks-vscode"
3+
- "@databricks/databricks-sdk"
64
- databricks-vscode
75
- "@databricks/databricks-vscode-types"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@databricks/databricks-vscode",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
55
"workspaces": [
66
"packages/*"

scripts/generate_changelog.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
PACKAGE=$1
2-
echo "## $PACKAGE" >> $2
1+
for PACKAGE in "packages/databricks-vscode" "packages/databricks-sdk" "packages/databricks-vscode-types" "."; do
2+
echo "## $PACKAGE" >> $2
33

4-
TAG=$(git describe --abbrev=0 --match "release-v*")
5-
if [ $? -ne 0 ]; then
6-
echo "No release tag matching pattern 'release-v*' found. Generating changelog from beggining"
7-
yarn conventional-changelog -k $PACKAGE --commit-path $PACKAGE >> $2
8-
else
9-
echo "Release tag found. Generating changelog from $TAG"
10-
yarn conventional-changelog --tag-prefix="release-v" -k $PACKAGE --commit-path $PACKAGE >> $2
11-
fi
4+
TAG=$(git describe --abbrev=0 --match "release-v*")
5+
if [ $? -ne 0 ]; then
6+
echo "No release tag matching pattern 'release-v*' found. Generating changelog from beggining"
7+
yarn conventional-changelog -k $PACKAGE --commit-path $PACKAGE >> $2
8+
else
9+
echo "Release tag found. Generating changelog from $TAG"
10+
yarn conventional-changelog --tag-prefix="release-v" -k $PACKAGE --commit-path $PACKAGE >> $2
11+
fi
12+
done

0 commit comments

Comments
 (0)