Skip to content

Commit d8ed4f6

Browse files
committed
fix: update release workflow to use GitHub CLI instead of deprecated action
1 parent 839ac37 commit d8ed4f6

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ on:
1919
jobs:
2020
create-release:
2121
runs-on: ubuntu-latest
22-
outputs:
23-
upload_url: ${{ steps.create_release.outputs.upload_url }}
22+
permissions:
23+
contents: write
2424

2525
steps:
2626
- name: Checkout code
@@ -31,23 +31,21 @@ jobs:
3131
run: |
3232
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
3333
if [[ "$TAG_NAME" == *"beta"* ]] || [[ "$TAG_NAME" == *"alpha"* ]] || [[ "${{ github.event.inputs.prerelease }}" == "true" ]]; then
34-
echo "prerelease=true" >> $GITHUB_OUTPUT
34+
echo "prerelease=--prerelease" >> $GITHUB_OUTPUT
3535
echo "release_type=Pre-release" >> $GITHUB_OUTPUT
3636
else
37-
echo "prerelease=false" >> $GITHUB_OUTPUT
37+
echo "prerelease=" >> $GITHUB_OUTPUT
3838
echo "release_type=Release" >> $GITHUB_OUTPUT
3939
fi
4040
41-
- name: Create Release
42-
id: create_release
43-
uses: actions/create-release@v1
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
tag_name: ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
48-
release_name: ${{ steps.release-type.outputs.release_type }} ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
49-
body: |
50-
## What's Changed
41+
- name: Create Release with GitHub CLI
42+
run: |
43+
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
44+
RELEASE_TITLE="${{ steps.release-type.outputs.release_type }} $TAG_NAME"
45+
46+
gh release create "$TAG_NAME" \
47+
--title "$RELEASE_TITLE" \
48+
--notes "## What's Changed
5149
5250
- Automated release of commitweave CLI tool
5351
- Enhanced commit message creation with emoji support
@@ -57,25 +55,26 @@ jobs:
5755
## Installation
5856
5957
### Stable Release
60-
```bash
58+
\`\`\`bash
6159
npm install -g @typeweaver/commitweave
62-
```
60+
\`\`\`
6361
6462
### Beta Release
65-
```bash
63+
\`\`\`bash
6664
npm install -g @typeweaver/commitweave@beta
67-
```
65+
\`\`\`
6866
6967
## Usage
7068
71-
```bash
69+
\`\`\`bash
7270
commitweave # Start interactive commit creation
7371
commitweave init # Initialize configuration
74-
```
72+
\`\`\`
7573
76-
Full changelog: https://github.com/GLINCKER/commitweave/compare/v0.1.0-beta.1...${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
77-
draft: false
78-
prerelease: ${{ steps.release-type.outputs.prerelease }}
74+
Full changelog: https://github.com/GLINCKER/commitweave/commits/$TAG_NAME" \
75+
${{ steps.release-type.outputs.prerelease }}
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7978

8079
publish-npm:
8180
needs: create-release

0 commit comments

Comments
 (0)