Skip to content

Manual crates publication #2

Manual crates publication

Manual crates publication #2

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-common, mithril-client ]
include:
- package: mithril-stm
api_token_secret_name: CRATES_IO_API_TOKEN
- 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@v3
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] }}