9
9
branches :
10
10
- main
11
11
12
+ env :
13
+ CARGO_INCREMENTAL : 0
14
+ CARGO_NET_GIT_FETCH_WITH_CLI : true
15
+ CARGO_NET_RETRY : 10
16
+ CARGO_TERM_COLOR : always
17
+ RUST_BACKTRACE : 1
18
+ RUSTFLAGS : -D warnings
19
+ RUSTUP_MAX_RETRIES : 10
20
+
21
+ defaults :
22
+ run :
23
+ shell : bash
24
+
12
25
jobs :
13
- release-plz :
26
+ release :
14
27
name : Release-plz
15
28
runs-on : ubuntu-latest
29
+ outputs :
30
+ releases_created : ${{ steps.release-plz.outputs.releases_created }}
31
+ tag : ${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }}
16
32
steps :
17
33
- name : Checkout repository
18
34
uses : actions/checkout@v4
@@ -21,10 +37,64 @@ jobs:
21
37
- name : Install Rust toolchain
22
38
uses : dtolnay/rust-toolchain@stable
23
39
- name : Run release-plz
40
+ id : release-plz
24
41
25
42
with :
26
43
command : release
27
44
manifest_path : Cargo.toml
28
45
env :
29
46
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
47
CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
48
+ - name : Read release output
49
+ env :
50
+ TAG : ${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }}
51
+ RELEASES_CREATED : ${{ steps.release-plz.outputs.releases_created }}
52
+ run : |
53
+ set -e
54
+ echo "releases_created: $RELEASES_CREATED"
55
+ echo "release_tag: $TAG"
56
+
57
+ upload-assets :
58
+ name : ${{ matrix.target }}
59
+ needs : release
60
+ if : github.repository_owner == 'rming' && needs.release.outputs.releases_created == 'true'
61
+ runs-on : ${{ matrix.os }}
62
+ strategy :
63
+ matrix :
64
+ include :
65
+ - target : aarch64-unknown-linux-gnu
66
+ os : ubuntu-latest
67
+ - target : aarch64-apple-darwin
68
+ os : macos-latest
69
+ - target : aarch64-pc-windows-msvc
70
+ os : windows-latest
71
+ - target : x86_64-unknown-linux-gnu
72
+ os : ubuntu-latest
73
+ - target : x86_64-apple-darwin
74
+ os : macos-latest
75
+ - target : x86_64-pc-windows-msvc
76
+ os : windows-latest
77
+ timeout-minutes : 60
78
+ steps :
79
+ - name : Checkout repository
80
+ uses : actions/checkout@v4
81
+ - name : Install Rust toolchain
82
+ uses : dtolnay/rust-toolchain@stable
83
+ - uses : taiki-e/setup-cross-toolchain-action@v1
84
+ with :
85
+ target : ${{ matrix.target }}
86
+ if : startsWith(matrix.os, 'ubuntu')
87
+
88
+ - name : RUSTFLAGS for Windows
89
+ if : endsWith(matrix.target, 'windows-msvc')
90
+ run : |
91
+ echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
92
+
93
+ - uses : taiki-e/upload-rust-binary-action@v1
94
+ with :
95
+ bin : dify-openai-apis
96
+ target : ${{ matrix.target }}
97
+ tar : all
98
+ zip : windows
99
+ token : ${{ secrets.GITHUB_TOKEN }}
100
+ ref : " refs/tags/${{ needs.release.outputs.tag }}"
0 commit comments