11[tools ]
22dprint = " latest"
3- bun = " latest"
3+ action-validator = " latest"
44github-cli = " latest"
55
66[tasks .format ]
7+ alias = " fmt"
78description = " Format code using dprint"
89run = " dprint fmt"
910
10- [tasks .check ]
11- description = " Check code formatting and run all validations (like CI)"
12- run = [
13- " echo '=== Checking code formatting with dprint ==='" ,
14- " dprint check" ,
15- " echo '=== Validating action.yml ==='" ,
16- " bunx @action-validator/core action.yml" ,
17- " echo '=== All checks completed ==='" ,
18- ]
11+ [tasks ."lint:config" ]
12+ description = " Check code formatting of toml, json, yaml, ..."
13+ run = " dprint check"
14+
15+ [tasks ."lint:action_yaml" ]
16+ description = " Validating action.yml"
17+ run = " action-validator action.yml"
18+
19+ [tasks .lint ]
20+ description = " Run all lint"
21+ depends = [" lint:*" ]
1922
2023[tasks .ci ]
2124description = " Run all CI checks locally"
22- alias = " check "
25+ depends = [ " lint " ]
2326
2427[tasks .release ]
25- description = " Create a new release with version tag (usage: mise run release -- v1.2.3)"
28+ description = " Create a new release with version tag (usage: mise run release v1.2.3)"
2629depends = [" check" ]
2730run = '''
28- if [ -z "$1" ]; then
29- echo 'Error: Please provide version (e.g., mise run release -- v1.2.3)'
31+ VERSION="{{arg(name="version")}}"
32+
33+ if [ -z "$VERSION" ]; then
34+ echo 'Error: Please provide version (e.g., mise run release v1.2.3)'
3035 exit 1
3136 fi
32-
33- VERSION="$1"
37+
3438 MAJOR_VERSION=$(echo $VERSION | cut -d. -f1)
35-
39+
3640 echo "=== Creating GitHub Action release ==="
3741 echo "Version: $VERSION (major: $MAJOR_VERSION)"
38-
42+
3943 # Ensure we're on main branch and up to date
4044 git checkout main
4145 git pull origin main
42-
46+
4347 # Create and push version tag
4448 echo "Creating tag: $VERSION"
4549 git tag -a "$VERSION" -m "Release $VERSION"
4650 git push origin "$VERSION"
47-
51+
4852 # Create GitHub release using gh CLI
4953 echo "Creating GitHub release"
5054 gh release create "$VERSION" \
51- --title "Release $VERSION" \
52- --notes "## Changes
53-
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)
55+ --generate-notes
56+
57+ # Update major version tag (e.g., v1)
8158 echo "Updating major version tag: $MAJOR_VERSION"
8259 git tag -f -a "$MAJOR_VERSION" -m "Release $MAJOR_VERSION (latest: $VERSION)"
8360 git push origin "$MAJOR_VERSION" --force
84-
61+
8562 echo "=== Release completed! ==="
8663 echo "✅ Created version tag: $VERSION"
8764 echo "✅ Created GitHub release: $VERSION"
88- echo "✅ Updated major tag: $MAJOR_VERSION"
65+ echo "✅ Updated major tag: $MAJOR_VERSION"
8966 echo "📦 GitHub Marketplace will auto-update from the major version tag"
9067'''
9168
@@ -96,10 +73,10 @@ run = '''
9673 echo "=== Current Release Status ==="
9774 echo "Latest tags:"
9875 git tag --sort=-version:refname | head -5
99-
76+
10077 echo "Current branch:"
10178 git branch --show-current
102-
79+
10380 echo "Uncommitted changes:"
10481 git status --porcelain || echo "Working tree clean"
105- '''
82+ '''
0 commit comments