Skip to content

Fix swm341 ram size too large issue #632

Fix swm341 ram size too large issue

Fix swm341 ram size too large issue #632

# 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
- 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 ""
echo "::endgroup::"
echo "::group::Pushing tags to remote using 'cargo release push'"
cargo release push --no-confirm --execute --tag-prefix ""
echo "::endgroup::"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock