Skip to content

Commit f88f345

Browse files
committed
fix: release and others workflows
1 parent 64ced70 commit f88f345

File tree

6 files changed

+59
-107
lines changed

6 files changed

+59
-107
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: ci
22

33
on:
44
push:
@@ -8,37 +8,12 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
validate-action:
11+
ci:
1212
name: Validate GitHub Action
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v5
17-
18-
- name: Validate Action
19-
uses: mpalmer/[email protected]
20-
with:
21-
path: action.yml
22-
23-
format-check:
24-
name: Format Check (dprint)
25-
runs-on: ubuntu-latest
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v5
29-
30-
- name: Setup dprint
31-
uses: dprint/[email protected]
32-
33-
validate-shell:
34-
name: Validate Shell Scripts
35-
runs-on: ubuntu-latest
36-
if: ${{ hashFiles('**/*.sh') != '' }}
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v5
40-
41-
- name: ShellCheck
42-
uses: ludeeus/action-shellcheck@master
15+
- uses: actions/checkout@v5
4316
with:
44-
scandir: "."
17+
fetch-depth: 0
18+
- uses: jdx/mise-action@v3
19+
- run: mise run ci

.github/workflows/release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
name: Release
1+
name: release
22

33
on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version to release (e.g., v1.2.3)'
7+
description: "Version to release (e.g., v1.2.3)"
88
required: true
99
type: string
1010

1111
jobs:
1212
release:
13-
name: Create Release
1413
runs-on: ubuntu-latest
1514
permissions:
1615
contents: write
1716
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
2018
with:
2119
fetch-depth: 0
22-
23-
- name: Setup mise
24-
uses: jdx/mise-action@v2
25-
26-
- name: Create release
27-
run: mise run release -- ${{ inputs.version }}
20+
- uses: jdx/mise-action@v3
21+
- run: mise run release "${{ inputs.version }}"
2822
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Send CDEvents Action
1+
name: test
22

33
on:
44
push:

.mise.toml

Lines changed: 32 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,67 @@
11
[tools]
22
dprint = "latest"
3-
bun = "latest"
3+
action-validator = "latest"
44
github-cli = "latest"
55

66
[tasks.format]
7+
alias = "fmt"
78
description = "Format code using dprint"
89
run = "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]
2124
description = "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)"
26-
depends = ["check"]
28+
description = "Create a new release with version tag (usage: mise run release v1.2.3)"
2729
run = '''
28-
if [ -z "$1" ]; then
29-
echo 'Error: Please provide version (e.g., mise run release -- v1.2.3)'
30+
VERSION="{{arg(name="version")}}"
31+
32+
if [ -z "$VERSION" ]; then
33+
echo 'Error: Please provide version (e.g., mise run release v1.2.3)'
3034
exit 1
3135
fi
32-
33-
VERSION="$1"
36+
3437
MAJOR_VERSION=$(echo $VERSION | cut -d. -f1)
35-
38+
3639
echo "=== Creating GitHub Action release ==="
3740
echo "Version: $VERSION (major: $MAJOR_VERSION)"
38-
41+
3942
# Ensure we're on main branch and up to date
4043
git checkout main
4144
git pull origin main
42-
45+
4346
# Create and push version tag
4447
echo "Creating tag: $VERSION"
4548
git tag -a "$VERSION" -m "Release $VERSION"
4649
git push origin "$VERSION"
47-
50+
4851
# Create GitHub release using gh CLI
4952
echo "Creating GitHub release"
5053
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)
54+
--generate-notes
55+
56+
# Update major version tag (e.g., v1)
8157
echo "Updating major version tag: $MAJOR_VERSION"
8258
git tag -f -a "$MAJOR_VERSION" -m "Release $MAJOR_VERSION (latest: $VERSION)"
8359
git push origin "$MAJOR_VERSION" --force
84-
60+
8561
echo "=== Release completed! ==="
8662
echo "✅ Created version tag: $VERSION"
8763
echo "✅ Created GitHub release: $VERSION"
88-
echo "✅ Updated major tag: $MAJOR_VERSION"
64+
echo "✅ Updated major tag: $MAJOR_VERSION"
8965
echo "📦 GitHub Marketplace will auto-update from the major version tag"
9066
'''
9167

@@ -96,10 +72,10 @@ run = '''
9672
echo "=== Current Release Status ==="
9773
echo "Latest tags:"
9874
git tag --sort=-version:refname | head -5
99-
75+
10076
echo "Current branch:"
10177
git branch --show-current
102-
78+
10379
echo "Uncommitted changes:"
10480
git status --porcelain || echo "Working tree clean"
105-
'''
81+
'''

CONTRIBUTING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mise install
1717
```
1818

1919
This will automatically install:
20+
2021
- `dprint` - for code formatting
2122
- `bun` - for JavaScript tooling
2223
- `github-cli` - for GitHub operations
@@ -36,6 +37,7 @@ mise run check
3637
```
3738

3839
The `check` task runs:
40+
3941
- `dprint check` - validates code formatting
4042
- `bunx @action-validator/core action.yml` - validates GitHub Action schema
4143

@@ -52,6 +54,7 @@ git push origin feature-branch
5254
```
5355

5456
The test workflow validates:
57+
5558
- Basic CDEvent sending
5659
- HTTP endpoint integration
5760
- Custom headers
@@ -80,6 +83,7 @@ The test workflow validates:
8083
### Commit Messages
8184

8285
Use conventional commit format:
86+
8387
```
8488
type: description
8589
@@ -100,6 +104,7 @@ ci: improve test workflow performance
100104
4. Click **Run workflow**
101105

102106
The workflow will:
107+
103108
- Run all quality checks
104109
- Create and push version tag
105110
- Create GitHub release with usage examples
@@ -118,6 +123,7 @@ mise run release -- v1.2.3
118123
```
119124

120125
> **⚠️ Note**: Local releases require:
126+
>
121127
> - Write access to the repository
122128
> - GitHub CLI authenticated (`gh auth login`)
123129
> - Clean working directory on `main` branch
@@ -127,7 +133,7 @@ mise run release -- v1.2.3
127133
Follow [semantic versioning](https://semver.org/):
128134

129135
- **Patch** (`v1.0.1`): Bug fixes, documentation updates
130-
- **Minor** (`v1.1.0`): New features, backward-compatible changes
136+
- **Minor** (`v1.1.0`): New features, backward-compatible changes
131137
- **Major** (`v2.0.0`): Breaking changes, incompatible API changes
132138

133139
### Release Checklist
@@ -181,4 +187,4 @@ mise run release -- v1.2.3 # Create new release
181187

182188
This project follows the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). By participating, you agree to uphold this code.
183189

184-
Thank you for contributing! 🎉
190+
Thank you for contributing! 🎉

dprint.json renamed to dprint.jsonc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"indentWidth": 2,
44
"useTabs": false,
55
"newLineKind": "lf",
6-
"includes": ["**/*.{yml,yaml,md,json}"],
6+
"includes": ["**/*.{yml,yaml,md,json,jsonc,toml}"],
77
"excludes": ["node_modules", ".git", "target", "dist"],
88
"plugins": [
99
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
1010
"https://plugins.dprint.dev/markdown-0.19.0.wasm",
11-
"https://plugins.dprint.dev/json-0.20.0.wasm"
11+
"https://plugins.dprint.dev/json-0.20.0.wasm",
12+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
1213
],
1314
"markdown": {
14-
"textWrap": "maintain"
15+
"textWrap": "maintain",
1516
},
1617
"json": {
17-
"indentWidth": 2
18-
}
18+
"indentWidth": 2,
19+
},
1920
}

0 commit comments

Comments
 (0)