-
Notifications
You must be signed in to change notification settings - Fork 41
65 lines (60 loc) · 2.03 KB
/
manual-publish-crates.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Manual crates publication
on:
workflow_dispatch:
inputs:
commit_sha:
description: |
SHA of the commit on which the mithril crates should be obtained.
required: true
type: string
package:
description: |
Packages(s) to be published to crates.io registry.
required: true
type: choice
options:
- all
- mithril-stm
- mithril-common
- mithril-client
dry_run:
description: Dry run will not publish to crates.io registry.
required: true
type: boolean
default: true
jobs:
publish-crate:
strategy:
fail-fast: true
max-parallel: 1
matrix:
package:
[mithril-stm, mithril-build-script, mithril-common, mithril-client]
include:
- package: mithril-stm
api_token_secret_name: CRATES_IO_API_TOKEN
- package: mithril-build-script
api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_BUILD_SCRIPT
- package: mithril-common
api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_COMMON
- package: mithril-client
api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_CLIENT
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
if: inputs.package == matrix.package || inputs.package == 'all'
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha }}
- name: Install stable toolchain
if: inputs.package == matrix.package || inputs.package == 'all'
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: ${{ inputs.dry_run && 'Test publish' || 'Publish' }} package to crates.io
if: inputs.package == matrix.package || inputs.package == 'all'
uses: ./.github/workflows/actions/publish-crate-package
with:
dry_run: ${{ inputs.dry_run }}
package: ${{ matrix.package }}
api_token: ${{ secrets[matrix.api_token_secret_name] }}