Skip to content

Commit 553ab82

Browse files
committed
Merge pull request #x from dandehoon/release/v0.0.2
1 parent b7f5910 commit 553ab82

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ jobs:
1212
contents: write
1313

1414
# Only run if this is a merge commit (PR merge) and contains version bump
15-
if: "contains(github.event.head_commit.message, 'release: bump version to v')"
15+
if: |
16+
contains(github.event.head_commit.message, 'Merge pull request #') &&
17+
contains(github.event.head_commit.message, 'from dandehoon/release/v')
1618
1719
steps:
1820
- name: Checkout code
1921
uses: actions/checkout@v4
2022
with:
2123
fetch-depth: 0
2224

23-
- name: Extract version from commit message
25+
- name: Extract version from package.json
2426
id: extract-version
25-
uses: actions-ecosystem/action-regex-match@v2
26-
with:
27-
text: ${{ github.event.head_commit.message }}
28-
regex: 'release: bump version to v([\d.]+)'
29-
flags: gm
27+
run: |
28+
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
3029
3130
- name: Setup Node.js
3231
uses: actions/setup-node@v4
@@ -63,27 +62,28 @@ jobs:
6362
- name: Generate changelog
6463
id: changelog
6564
run: |
66-
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^)
67-
echo "Previous tag: $PREV_TAG"
68-
echo 'changelog<<EOF' >> $GITHUB_OUTPUT
69-
git log --pretty=format:'- %s (%an)' $PREV_TAG..HEAD >> $GITHUB_OUTPUT
70-
echo 'EOF' >> $GITHUB_OUTPUT
71-
72-
- name: Create Tag
73-
uses: mathieudutour/github-tag-action@v6.1
74-
with:
75-
custom_tag: v${{ steps.extract-version.outputs.group1 }}
76-
github_token: ${{ secrets.GITHUB_TOKEN }}
77-
tag_prefix: ''
78-
tag_message: 'Release v${{ steps.extract-version.outputs.group1 }}'
65+
DELIM=__CHANGELOG_EOF__
66+
if git tag | grep . >/dev/null; then
67+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^)
68+
echo "Previous tag: $PREV_TAG"
69+
echo "changelog<<$DELIM" >> $GITHUB_OUTPUT
70+
git log --pretty=format:'- %s (%an)' $PREV_TAG..HEAD >> $GITHUB_OUTPUT
71+
echo "$DELIM" >> $GITHUB_OUTPUT
72+
else
73+
echo "changelog<<$DELIM" >> $GITHUB_OUTPUT
74+
git log --pretty=format:'- %s (%an)' >> $GITHUB_OUTPUT
75+
echo "$DELIM" >> $GITHUB_OUTPUT
76+
fi
7977
8078
- name: Create GitHub Release
8179
uses: softprops/action-gh-release@v2
8280
with:
83-
tag_name: v${{ steps.extract-version.outputs.group1 }}
84-
name: Release v${{ steps.extract-version.outputs.group1 }}
81+
token: ${{ secrets.GITHUB_TOKEN }}
82+
tag_name: v${{ steps.extract-version.outputs.version }}
83+
target_commitish: ${{ github.sha }}
84+
name: Release v${{ steps.extract-version.outputs.version }}
8585
body: |
86-
## Release v${{ steps.extract-version.outputs.group1 }}
86+
## Release v${{ steps.extract-version.outputs.version }}
8787
8888
Automated release created from version bump commit.
8989
@@ -92,7 +92,7 @@ jobs:
9292
9393
**Installation:**
9494
- Download the `.vsix` file from the assets below
95-
- Install via VS Code: `code --install-extension vscode-generic-expand-selection-${{ steps.extract-version.outputs.group1 }}.vsix`
95+
- Install via VS Code: `code --install-extension vscode-generic-expand-selection-${{ steps.extract-version.outputs.version }}.vsix`
9696
- Or install from VS Code Extensions marketplace
9797
files: |
9898
out.vsix

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Generic Expand Selection",
44
"description": "Intelligently expand selection to nearest scoped characters like quotes, brackets, and more.",
55
"publisher": "dandehoon",
6-
"version": "0.0.1",
6+
"version": "0.0.2",
77
"repository": {
88
"type": "git",
99
"url": "git://github.com/dandehoon/vscode-generic-expand-selection.git"

0 commit comments

Comments
 (0)