Skip to content

Commit da6f79d

Browse files
committed
further release tweaks
1 parent b6674d6 commit da6f79d

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515

1616
jobs:
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:
@@ -50,33 +62,6 @@ jobs:
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 }}

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ cargo-binstall = "latest" # For installing binaries from crates.io
66
"cargo:cargo-deny" = "latest" # For checking licenses and other policies.
77
"cargo:cargo-nextest" = "latest" # For running tests in parallel.
88
"cargo:cargo-watch" = "latest" # For watching files and rerunning commands.
9+
gh = "latest"
910
hk = "latest" # Handles git hooks, like pre-commit.
1011
jq = "latest"
1112
"npm:prettier" = "latest"

0 commit comments

Comments
 (0)