-
Notifications
You must be signed in to change notification settings - Fork 60
50 lines (47 loc) · 1.52 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: "Publish to crates.io"
permissions:
pull-requests: write
contents: write
on:
workflow_dispatch:
jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Generate GitHub token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.RELEASER_APP_ID }}
private-key: ${{ secrets.RELEASER_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Set git identity
run: |
git config --global user.name "pavex-releaser[bot]"
git config --global user.email "[email protected]"
- name: Remove workspace hack from Cargo.toml
run: |
cd libs
cargo hakari disable
cargo hakari remove-deps -y
git add .
git commit -am "Disable workspace hack before a release" || echo "No changes to commit"
- name: Run release-plz
uses: MarcoIeni/[email protected]
with:
project_manifest: "libs/Cargo.toml"
config: "libs/.release-plz.toml"
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}