4
4
workflow_dispatch :
5
5
inputs :
6
6
release_type :
7
- description : ' Release type'
7
+ description : " Release type"
8
8
required : true
9
- default : ' patch'
9
+ default : " patch"
10
10
type : choice
11
11
options :
12
- - patch
13
- - minor
14
- - major
12
+ - patch
13
+ - minor
14
+ - major
15
15
16
16
permissions :
17
17
contents : write
@@ -20,77 +20,71 @@ permissions:
20
20
jobs :
21
21
release :
22
22
runs-on : ubuntu-latest
23
-
24
- steps :
25
- - name : Checkout
26
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27
- with :
28
- fetch-depth : 0
29
- token : ${{ secrets.GITHUB_TOKEN }}
30
-
31
- - name : Setup Node.js
32
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
33
- with :
34
- node-version : ' 20'
35
23
36
- - name : Install semver CLI
37
- run : npm install -g semver
38
-
39
- - name : Get current version
40
- id : current_version
41
- run : |
42
- CURRENT_VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
43
- echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
44
- echo "Current version: $CURRENT_VERSION"
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27
+ with :
28
+ fetch-depth : 0
29
+ token : ${{ secrets.GITHUB_TOKEN }}
45
30
46
- - name : Set release type
47
- id : release_type
48
- run : |
49
- RELEASE_TYPE="${{ github.event.inputs.release_type }}"
50
- echo "type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
51
- echo "Release type: $RELEASE_TYPE"
31
+ - name : Setup Node.js
32
+ uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
33
+ with :
34
+ node-version : " 20"
52
35
53
- - name : Calculate new version
54
- id : new_version
55
- run : |
56
- CURRENT_VERSION="${{ steps.current_version.outputs.current }}"
57
- RELEASE_TYPE="${{ steps.release_type.outputs.type }}"
58
- NEW_VERSION=$(semver -i $RELEASE_TYPE $CURRENT_VERSION)
59
-
60
- echo "new=$NEW_VERSION" >> $GITHUB_OUTPUT
61
- echo "New version: $NEW_VERSION"
36
+ - name : Install semver CLI
37
+ run : npm install -g semver
62
38
63
- - name : Update Cargo.toml
64
- run : |
65
- NEW_VERSION="${{ steps.new_version.outputs.new }}"
66
- sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" Cargo.toml
67
- echo "Updated Cargo.toml to version $NEW_VERSION"
39
+ - name : Get current version
40
+ id : current_version
41
+ run : |
42
+ CURRENT_VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
43
+ echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
44
+ echo "Current version: $CURRENT_VERSION"
68
45
46
+ - name : Set release type
47
+ id : release_type
48
+ run : |
49
+ RELEASE_TYPE="${{ github.event.inputs.release_type }}"
50
+ echo "type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
51
+ echo "Release type: $RELEASE_TYPE"
69
52
70
- - name : Commit version bump
71
- run : |
72
- NEW_VERSION="${{ steps.new_version.outputs.new }}"
73
- git config --local user.email "action@github.com"
74
- git config --local user.name "GitHub Action"
75
- git add Cargo.toml
76
- git commit -m "chore: release v$NEW_VERSION
53
+ - name : Calculate new version
54
+ id : new_version
55
+ run : |
56
+ CURRENT_VERSION="${{ steps.current_version.outputs.current }}"
57
+ RELEASE_TYPE="${{ steps.release_type.outputs.type }}"
58
+ NEW_VERSION=$(semver -i $RELEASE_TYPE $CURRENT_VERSION)
77
59
78
- 🤖 Generated with [Claude Code](https://claude.ai/code)
60
+ echo "new=$NEW_VERSION" >> $GITHUB_OUTPUT
61
+ echo "New version: $NEW_VERSION"
79
62
80
- Co-Authored-By : Claude <noreply@anthropic.com>"
63
+ - name : Update Cargo.toml
64
+ run : |
65
+ NEW_VERSION="${{ steps.new_version.outputs.new }}"
66
+ sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" Cargo.toml
67
+ echo "Updated Cargo.toml to version $NEW_VERSION"
81
68
82
- - name : Create and push tag
83
- run : |
84
- NEW_VERSION="${{ steps.new_version.outputs.new }}"
85
- git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
86
- git push origin main
87
- git push origin "v$NEW_VERSION"
69
+ - name : Commit version bump
70
+ run : |
71
+ NEW_VERSION="${{ steps.new_version.outputs.new }}"
72
+ git config --local user.email "action@github.com"
73
+ git config --local user.name "GitHub Action"
74
+ git add Cargo.toml
75
+ git commit -m "chore: release v$NEW_VERSION"
76
+ - name : Create and push tag
77
+ run : |
78
+ NEW_VERSION="${{ steps.new_version.outputs.new }}"
79
+ git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
80
+ git push origin main
81
+ git push origin "v$NEW_VERSION"
88
82
89
- - name : Trigger Homebrew update
90
- run : |
91
- NEW_VERSION="${{ steps.new_version.outputs.new }}"
92
- # Wait a moment for the release workflow to complete
93
- sleep 60
94
- gh workflow run "Update Homebrew Formula" --field tag="v$NEW_VERSION"
95
- env :
96
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83
+ - name : Trigger Homebrew update
84
+ run : |
85
+ NEW_VERSION="${{ steps.new_version.outputs.new }}"
86
+ # Wait a moment for the release workflow to complete
87
+ sleep 60
88
+ gh workflow run "Update Homebrew Formula" --field tag="v$NEW_VERSION"
89
+ env :
90
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments