Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,26 @@ jobs:

- name: Determine publish requirement
id: publish_check
env:
CRATE_NAME: ipc_ring
run: |
set -euo pipefail
CRATE_NAME="ipc_ring"
CRATE_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name==\"${CRATE_NAME}\") | .version")
PUBLISHED_VERSION=$(curl -sSf "https://crates.io/api/v1/crates/${CRATE_NAME}" | jq -r '.crate.max_version')
SEARCH_OUTPUT=$(mktemp)
PUBLISHED_VERSION="not-found"
if cargo search "${CRATE_NAME}" --limit 1 > "${SEARCH_OUTPUT}"; then
FIRST_LINE=$(head -n 1 "${SEARCH_OUTPUT}")
if printf '%s\n' "${FIRST_LINE}" | grep -q "^${CRATE_NAME} "; then
PARSED=$(printf '%s\n' "${FIRST_LINE}" | awk -F'"' '{print $2}')
if [ -n "${PARSED}" ]; then
PUBLISHED_VERSION="${PARSED}"
fi
fi
fi
if [ "${PUBLISHED_VERSION}" = "not-found" ]; then
PUBLISHED_VERSION=$(curl -sSf -H "User-Agent: ipc-ring-release-workflow (+https://github.com/${{ github.repository }})" \
"https://crates.io/api/v1/crates/${CRATE_NAME}" | jq -r '.crate.max_version' || echo "not-found")
fi
SHOULD_PUBLISH="true"
if [ -z "${PUBLISHED_VERSION}" ] || [ "${PUBLISHED_VERSION}" = "null" ]; then
PUBLISHED_VERSION="not-found"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ipc_ring"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors = ["Leander Kohler"]
description = "High-performance memory-mapped SPSC ring buffer for Unix IPC"
Expand Down