Skip to content

Commit fa94ff1

Browse files
committed
fix: release workflow
1 parent 64ced70 commit fa94ff1

File tree

2 files changed

+19
-45
lines changed

2 files changed

+19
-45
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
uses: jdx/mise-action@v2
2525

2626
- name: Create release
27-
run: mise run release -- ${{ inputs.version }}
27+
run: mise run release "${{ inputs.version }}"
2828
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.mise.toml

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,70 +22,44 @@ description = "Run all CI checks locally"
2222
alias = "check"
2323

2424
[tasks.release]
25-
description = "Create a new release with version tag (usage: mise run release -- v1.2.3)"
25+
description = "Create a new release with version tag (usage: mise run release v1.2.3)"
2626
depends = ["check"]
2727
run = '''
28-
if [ -z "$1" ]; then
29-
echo 'Error: Please provide version (e.g., mise run release -- v1.2.3)'
28+
VERSION="{{arg(name="version")}}"
29+
30+
if [ -z "$VERSION" ]; then
31+
echo 'Error: Please provide version (e.g., mise run release v1.2.3)'
3032
exit 1
3133
fi
32-
33-
VERSION="$1"
34+
3435
MAJOR_VERSION=$(echo $VERSION | cut -d. -f1)
35-
36+
3637
echo "=== Creating GitHub Action release ==="
3738
echo "Version: $VERSION (major: $MAJOR_VERSION)"
38-
39+
3940
# Ensure we're on main branch and up to date
4041
git checkout main
4142
git pull origin main
42-
43+
4344
# Create and push version tag
4445
echo "Creating tag: $VERSION"
4546
git tag -a "$VERSION" -m "Release $VERSION"
4647
git push origin "$VERSION"
47-
48+
4849
# Create GitHub release using gh CLI
4950
echo "Creating GitHub release"
5051
gh release create "$VERSION" \
51-
--title "Release $VERSION" \
52-
--notes "## Changes
52+
--generate-notes
5353
54-
See [CHANGELOG.md](https://github.com/cdviz-dev/send-cdevents/blob/main/CHANGELOG.md) for details.
55-
56-
## Usage
57-
58-
\`\`\`yaml
59-
- name: Send CDEvent
60-
uses: cdviz-dev/send-cdevents@$VERSION
61-
with:
62-
data: |
63-
{
64-
\"context\": {
65-
\"version\": \"0.4.1\",
66-
\"source\": \"github-actions\",
67-
\"type\": \"dev.cdevents.taskrun.started.0.2.0\"
68-
},
69-
\"subject\": {
70-
\"id\": \"\${{ github.run_id }}\",
71-
\"type\": \"taskRun\",
72-
\"content\": {
73-
\"taskName\": \"ci-build\"
74-
}
75-
}
76-
}
77-
url: \"https://your-webhook-endpoint.com/cdevents\"
78-
\`\`\`"
79-
80-
# Update major version tag (e.g., v1)
54+
# Update major version tag (e.g., v1)
8155
echo "Updating major version tag: $MAJOR_VERSION"
8256
git tag -f -a "$MAJOR_VERSION" -m "Release $MAJOR_VERSION (latest: $VERSION)"
8357
git push origin "$MAJOR_VERSION" --force
84-
58+
8559
echo "=== Release completed! ==="
8660
echo "✅ Created version tag: $VERSION"
8761
echo "✅ Created GitHub release: $VERSION"
88-
echo "✅ Updated major tag: $MAJOR_VERSION"
62+
echo "✅ Updated major tag: $MAJOR_VERSION"
8963
echo "📦 GitHub Marketplace will auto-update from the major version tag"
9064
'''
9165

@@ -96,10 +70,10 @@ run = '''
9670
echo "=== Current Release Status ==="
9771
echo "Latest tags:"
9872
git tag --sort=-version:refname | head -5
99-
73+
10074
echo "Current branch:"
10175
git branch --show-current
102-
76+
10377
echo "Uncommitted changes:"
10478
git status --porcelain || echo "Working tree clean"
105-
'''
79+
'''

0 commit comments

Comments
 (0)