1414 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1515
1616jobs :
17+ create-release :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - uses : actions/checkout@v4
21+ - uses : taiki-e/create-gh-release-action@v1
22+ if : github.event_name != 'workflow_dispatch'
23+ with :
24+ changelog : CHANGELOG.md
25+ token : ${{ secrets.GITHUB_TOKEN }}
26+ draft : true
27+
1728 build :
1829 runs-on : ${{ matrix.os }}
30+ needs : [create-release]
1931 strategy :
2032 fail-fast : false
2133 matrix :
5062 features : git2/vendored-libgit2,git2/vendored-openssl
5163 dry-run : ${{ github.event_name == 'workflow_dispatch' }}
5264
53- publish :
54- name : Publish to crates.io
55- needs : [build]
56- runs-on : ubuntu-latest
57- steps :
58- - uses : actions/checkout@v4
59- with :
60- submodules : recursive
61-
62- - name : Install Rust
63- uses : dtolnay/rust-toolchain@stable
64-
65- - name : Cache cargo registry
66- uses : actions/cache@v4
67- with :
68- path : ~/.cargo/registry
69- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
70-
71- - name : Cache cargo index
72- uses : actions/cache@v4
73- with :
74- path : ~/.cargo/git
75- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
76-
77- - name : Publish to crates.io
78- run : cargo publish --token ${{ secrets.CRATESIO_KEY }}
79-
8065 github_release :
8166 name : Create GitHub Release
8267 needs : [build, publish]
@@ -100,3 +85,20 @@ jobs:
10085 prerelease : false
10186 env :
10287 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88+
89+ publish :
90+ name : Publish to crates.io
91+ needs : [build]
92+ runs-on : ubuntu-latest
93+ steps :
94+ - uses : actions/checkout@v4
95+ with :
96+ submodules : recursive
97+
98+ - uses : actions-rs/toolchain@v1
99+ with :
100+ toolchain : stable
101+ override : true
102+ - uses : katyo/publish-crates@v2
103+ with :
104+ registry-token : ${{ secrets.CRATESIO_KEY }}
0 commit comments