@@ -12,14 +12,14 @@ jobs:
12
12
strategy :
13
13
matrix :
14
14
include :
15
- - os : windows-2022
16
- target : x86_64-pc-windows-msvc
17
- - os : ubuntu-22.04
18
- target : x86_64-unknown-linux-gnu
19
- - os : macos-12
20
- target : x86_64-apple-darwin
21
- - os : macos-12
22
- target : aarch64-apple-darwin
15
+ - os : windows-2022
16
+ target : x86_64-pc-windows-msvc
17
+ - os : ubuntu-22.04
18
+ target : x86_64-unknown-linux-gnu
19
+ - os : macos-12
20
+ target : x86_64-apple-darwin
21
+ - os : macos-12
22
+ target : aarch64-apple-darwin
23
23
24
24
runs-on : ${{ matrix.os }}
25
25
46
46
shopt -s extglob
47
47
staging="keep-active-${{ github.head_ref || github.ref_name }}-${{ matrix.target }}"
48
48
mkdir $staging
49
-
50
49
cp target/${{ matrix.target }}/release/keep-active@(|.exe) $staging/
51
50
cp README.md CHANGELOG.md LICENSE $staging/
52
-
53
51
tar zcf $staging.tar.gz $staging
54
52
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
55
53
63
61
if : startsWith(github.ref, 'refs/tags/')
64
62
with :
65
63
draft : true
66
- files : ${{ env.ASSET }}
64
+ files : ${{ env.ASSET }}
65
+
66
+ publish-crate :
67
+ needs : [release] # This job depends on the successful completion of the 'release' job
68
+ runs-on : ubuntu-latest
69
+ if : startsWith(github.ref, 'refs/tags/') # Only runs this job if the push is a tag
70
+ steps :
71
+ - uses : actions/checkout@v3
72
+
73
+ - name : Setup Rust
74
+ uses : actions-rust-lang/setup-rust-toolchain@v1
75
+ with :
76
+ profile : minimal # Only install what's necessary
77
+
78
+ - name : Publish to crates.io
79
+ env :
80
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_TOKEN }} # Use the secret token
81
+ run : cargo publish --token $CARGO_REGISTRY_TOKEN
0 commit comments