Skip to content

Commit 3e57a77

Browse files
committed
Auto merge of rust-lang#14026 - jonas-schievink:fix-libs-publish, r=jonas-schievink
internal: Try to fix auto-publishing of lib crates rust-lang/rust-analyzer#13912
2 parents 46084a1 + 7cb0cfa commit 3e57a77

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

.github/workflows/publish.yml renamed to .github/workflows/autopublish.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish
1+
name: autopublish
22
on:
33
workflow_dispatch: # We can add version input when 1.0 is released and scheduled releases are removed
44

@@ -25,7 +25,7 @@ jobs:
2525
- name: Install cargo-workspaces
2626
run: cargo install cargo-workspaces
2727

28-
- name: Release
28+
- name: Publish Crates
2929
env:
3030
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3131
PATCH: ${{ github.run_number }}

.github/workflows/publish-libs.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: publish-libs
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'lib/**'
9+
10+
jobs:
11+
publish-libs:
12+
name: publish
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install Rust toolchain
21+
run: rustup update --no-self-update stable
22+
23+
- name: Install cargo-workspaces
24+
run: cargo install cargo-workspaces
25+
26+
- name: Publish Crates
27+
env:
28+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
29+
shell: bash
30+
run: |
31+
git config --global user.email "[email protected]"
32+
git config --global user.name "Github Action"
33+
# Remove r-a crates from the workspaces so we don't auto-publish them as well
34+
sed -i 's/ "crates\/\*"//' ./Cargo.toml
35+
cargo workspaces publish --yes --exact --from-git --no-git-commit --allow-dirty

0 commit comments

Comments
 (0)