Release #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump: | |
description: "Specify how to bump the version for Hydro crates. Does not affect dependencies." | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
- keep | |
- auto | |
execute: | |
description: "Actually execute and publish the release?" | |
required: true | |
type: boolean | |
default: false | |
jobs: | |
release_job: | |
name: Release Job | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/orgs/community/discussions/25305#discussioncomment-8256560 | |
# Unfortunately branch protection means that this workflow can't push the updated changelogs | |
# and tags to `main` in the normal way. Instead we have an app: | |
# https://github.com/organizations/hydro-project/settings/apps/hydro-project-bot | |
# Which is added the the users allowed to bypass branch protections: | |
# https://github.com/hydro-project/hydro/settings/branches | |
# We grab a token from the app using this action via the `APP_ID` ("App ID") and an | |
# `APP_PRIVATE_KEY` ("Generate a private key"). | |
- name: Generate token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- run: | | |
echo "Version bump: $BUMP" | |
echo "Execute: $EXECUTE" | |
env: | |
BUMP: ${{ inputs.bump }} | |
EXECUTE: ${{ inputs.execute }} | |
# https://api.github.com/users/hydro-project-bot[bot] | |
- name: Configure git | |
run: | | |
git config --global user.name "hydro-project-bot[bot]" | |
git config --global user.email "132423234+hydro-project-bot[bot]@users.noreply.github.com" | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
# Fetch all commit history so smart-release can generate changelogs. | |
fetch-depth: 0 | |
token: ${{ steps.generate_token.outputs.token }} | |
- name: Install nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
- name: Run cargo login | |
uses: actions-rs/cargo@v1 | |
with: | |
command: login | |
args: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Install cargo-smart-release | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cargo-smart-release | |
- name: Run cargo smart-release | |
# list lockstep-versioned packages at the end of this command | |
run: >- | |
cargo smart-release --update-crates-index | |
--no-changelog-preview --allow-fully-generated-changelogs | |
--bump ${{ inputs.bump }} --bump-dependencies auto | |
${{ inputs.execute && '--execute' || '--no-publish' }} | |
dfir_rs dfir_lang dfir_macro | |
dfir_datalog dfir_datalog_core | |
hydro_lang hydro_std | |
hydro_deploy hydro_cli hydroflow_deploy_integration | |
stageleft stageleft_macro stageleft_tool | |
multiplatform_test | |
env: | |
# Make sure to set this so the `gh` CLI works using our token. | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
# Show `cargo-smart-release`'s stack trace on error. | |
RUST_BACKTRACE: 1 |