Update to latest serde_yaml #1023
Workflow file for this run
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
# This Action is triggered when a PR with the label 'release' is closed and merged into 'master'. | |
# It publishes the crates in the repo to crates.io, and will create a tag in the probe-rs repo. | |
on: | |
pull_request: | |
branches: [master] | |
types: [closed] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
name: Release on crates.io | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')) | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # This is a workaround for cargo-release, see https://github.com/crate-ci/cargo-release/issues/625 | |
# We need to manually set a token here to ensure that we can trigger the `cargo dist` workflow. | |
# | |
# By default, pushing a tag from a workflow does not trigger other workflows, which means that the release | |
# workflow isn't triggered by pushing a tag from this workflow. Manually setting a token is a workaround for | |
# this, see https://github.com/orgs/community/discussions/57484' | |
token: ${{ secrets.GH_PAT }} | |
- name: Install libudev (linux) | |
run: | | |
sudo apt update | |
sudo apt install -y libudev-dev | |
- uses: chainguard-dev/actions/setup-gitsign@main | |
- name: install cargo-release | |
run: | | |
curl -LsSf https://github.com/crate-ci/cargo-release/releases/download/v0.24.8/cargo-release-v0.24.8-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin | |
- name: Install SSH | |
run: | | |
sudo apt-get update -y && sudo apt-get install openssh-client -y | |
eval $(ssh-agent -s -a $SSH_AUTH_SOCK) | |
echo "$SSH_SIGNING_KEY" | tr -d '\r' | ssh-add - | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
env: | |
SSH_SIGNING_KEY: ${{ secrets.SSH_SIGNING_KEY }} | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
- name: Git setup | |
run: | | |
git config user.name "probe-rs" | |
git config user.email "bot@probe.rs" | |
git config --global gpg.format ssh | |
git config --global user.signingkey "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGr8+OZiQ6EHlhZcsPbnbkiW0wBtgNYGR2J5SI+QOw9Q bot@probe.rs" | |
- name: Extract crate version | |
id: crate_version | |
run: | | |
VERSION=$(cargo pkgid -p probe-rs | cut -d# -f2 | cut -d: -f2) | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
# The tag prefix is set to an empty string, so that the tag is just the version number, and doesn't contain the crate name. | |
- name: release to crates.io | |
run: | | |
git checkout master | |
echo "::group::Setup auth for crates.io" | |
cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
echo "::endgroup::" | |
echo "::group::Publishing on crates.io using 'cargo release publish'" | |
cargo release publish --no-confirm --execute | |
echo "::endgroup::" | |
echo "::group::Tagging release using 'cargo release tag'" | |
cargo release tag --no-confirm --execute --sign-tag --tag-prefix "" --exclude probe-rs-mi | |
# `|| true` to avoid "no package selected" errors if probe-rs-mi is not updated | |
cargo release tag --no-confirm --execute --sign-tag --package probe-rs-mi || true | |
echo "::endgroup::" | |
echo "::group::Pushing tags to remote using 'cargo release push'" | |
cargo release push --no-confirm --execute --tag-prefix "" --exclude probe-rs-mi | |
# `|| true` to avoid "no package selected" errors if probe-rs-mi is not updated | |
cargo release push --no-confirm --execute --package probe-rs-mi || true | |
echo "::endgroup::" | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock |