9
9
jobs :
10
10
create-release :
11
11
runs-on : ubuntu-latest
12
+
13
+ outputs :
14
+ APP_VERSION : ${{ steps.get-version.outputs.APP_VERSION }}
15
+ RELEASE_BODY : ${{ steps.get-changelog.outputs.RELEASE_BODY }}
16
+
12
17
steps :
13
18
- uses : actions/checkout@v4
14
19
with :
15
20
fetch-depth : 0
21
+
16
22
- name : Set output
17
23
id : vars
18
24
run : echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
@@ -22,11 +28,28 @@ jobs:
22
28
with :
23
29
node-version : 20
24
30
31
+ - name : Get build version
32
+ shell : bash
33
+ id : get-version
34
+ run : |
35
+ PACKAGE_VERSION=$(jq -r '.version' package.json)
36
+ CARGO_VERSION=$(grep -m 1 '^version =' src-tauri/Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')
37
+ if [ "$PACKAGE_VERSION" != "$CARGO_VERSION" ]; then
38
+ echo "::error::Version mismatch!"
39
+ else
40
+ echo "Version match: $PACKAGE_VERSION"
41
+ fi
42
+ echo "APP_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
43
+
25
44
- name : Generate changelog
26
- id : create_release
27
- run : npx changelogithub --draft --name ${{ steps.vars.outputs.tag }}
45
+ id : get-changelog
46
+ run : |
47
+ CHANGELOG_BODY=$(npx changelogithub --draft --name ${{ steps.vars.outputs.tag }})
48
+ echo "RELEASE_BODY<<EOF" >> $GITHUB_OUTPUT
49
+ echo "$CHANGELOG_BODY" >> $GITHUB_OUTPUT
50
+ echo "EOF" >> $GITHUB_OUTPUT
28
51
env :
29
- GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
52
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
53
31
54
build-app :
32
55
needs : create-release
52
75
target : " x86_64-unknown-linux-gnu"
53
76
- platform : " ubuntu-22.04-arm"
54
77
target : " aarch64-unknown-linux-gnu"
78
+ env :
79
+ APP_VERSION : ${{ needs.create-release.outputs.APP_VERSION }}
80
+ RELEASE_BODY : ${{ needs.create-release.outputs.RELEASE_BODY }}
55
81
56
82
runs-on : ${{ matrix.platform }}
57
83
steps :
81
107
sudo apt-get update
82
108
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
83
109
84
- - name : Add Rust build target for ${{ matrix.target }}
110
+ - name : Add Rust build target at ${{ matrix.platform}} for ${{ matrix.target }}
85
111
working-directory : src-tauri
86
112
shell : bash
87
113
run : |
@@ -115,7 +141,7 @@ jobs:
115
141
- name : Install app dependencies and build web
116
142
run : pnpm install --frozen-lockfile
117
143
118
- - name : Build the app with ${{ matrix.platform }}
144
+ - name : Build the coco at ${{ matrix.platform}} for ${{ matrix.target }} @ ${{ env.APP_VERSION }}
119
145
uses : tauri-apps/tauri-action@v0
120
146
env :
121
147
CI : false
@@ -131,8 +157,8 @@ jobs:
131
157
APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
132
158
with :
133
159
tagName : ${{ github.ref_name }}
134
- releaseName : Coco ${{ needs.create-release.outputs .APP_VERSION }}
135
- releaseBody : " "
160
+ releaseName : Coco ${{ env .APP_VERSION }}
161
+ releaseBody : " ${{ env.RELEASE_BODY }} "
136
162
releaseDraft : true
137
163
prerelease : false
138
164
args : ${{ env.BUILD_ARGS }}
0 commit comments