File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,47 @@ name: "build and publish cross"
3
3
on : workflow_dispatch
4
4
5
5
jobs :
6
+ check-version :
7
+ runs-on : ubuntu-latest
8
+ outputs :
9
+ should_release : ${{ steps.check_version.outputs.should_release }}
10
+ steps :
11
+ - uses : actions/checkout@v4
12
+ with :
13
+ fetch-depth : 0
14
+
15
+ - name : Get latest tag
16
+ id : get_latest_tag
17
+ run : |
18
+ LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
19
+ echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
20
+ echo "Latest tag: ${LATEST_TAG}"
21
+
22
+ - name : Extract version from tauri.conf.json
23
+ id : extract_version
24
+ run : |
25
+ VERSION=$(grep -o '"version": "[^"]*"' ./postier-app/src-tauri/tauri.conf.json | cut -d '"' -f 4)
26
+ echo "CONF_VERSION=${VERSION}" >> $GITHUB_ENV
27
+ echo "Config version: ${VERSION}"
28
+
29
+ - name : Check if versions are different
30
+ id : check_version
31
+ run : |
32
+ LATEST_TAG_VERSION=${LATEST_TAG#v}
33
+ echo "Latest tag version (without v): ${LATEST_TAG_VERSION}"
34
+ echo "Config version: ${CONF_VERSION}"
35
+
36
+ if [ "$LATEST_TAG_VERSION" != "$CONF_VERSION" ]; then
37
+ echo "Versions are different, should release"
38
+ echo "should_release=true" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "Versions are the same, should not release"
41
+ echo "should_release=false" >> $GITHUB_OUTPUT
42
+ fi
43
+
6
44
publish-tauri :
45
+ needs : check-version
46
+ if : needs.check-version.outputs.should_release == 'true'
7
47
permissions :
8
48
contents : write
9
49
strategy :
You can’t perform that action at this time.
0 commit comments