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
59 changes: 40 additions & 19 deletions .github/workflows/release-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,45 @@ jobs:
restore-keys: crates-io-
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- uses: dkdc-io/.github/actions/publish-crate@v1
with:
crate: dkdc-bookmarks-core
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- uses: dkdc-io/.github/actions/publish-crate@v1
with:
crate: dkdc-bookmarks-webapp
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- uses: dkdc-io/.github/actions/publish-crate@v1
with:
crate: dkdc-bookmarks-app
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- uses: dkdc-io/.github/actions/publish-crate@v1
with:
crate: dkdc-bookmarks
last: "true"
- name: Publish crates
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
run: |
set -euo pipefail

version="${RELEASE_TAG#v}"

crate_version_exists() {
local crate="$1"
curl -fsSL "https://crates.io/api/v1/crates/${crate}/versions" \
| jq -e --arg version "$version" '.versions[] | select(.num == $version and (.yanked | not))' >/dev/null
}

wait_for_crate_version() {
local crate="$1"
for _ in {1..12}; do
if crate_version_exists "$crate"; then
return 0
fi
sleep 10
done
echo "::error::${crate} ${version} was not visible on crates.io after publishing"
return 1
}

publish_crate() {
local crate="$1"
if crate_version_exists "$crate"; then
echo "${crate} ${version} already exists on crates.io, skipping publish"
else
echo "Publishing ${crate} ${version}..."
cargo publish -p "$crate"
fi
wait_for_crate_version "$crate"
}

publish_crate dkdc-bookmarks-core
publish_crate dkdc-bookmarks-webapp
publish_crate dkdc-bookmarks-app
publish_crate dkdc-bookmarks
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
target/
crates/bookmarks-app/gen/
*.pyc
__pycache__/
*.so
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

40 changes: 32 additions & 8 deletions bin/release-crates-io
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,40 @@
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."

echo "Publishing dkdc-bookmarks-core to crates.io..."
cargo publish -p dkdc-bookmarks-core
version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "dkdc-bookmarks") | .version')"

echo "Publishing dkdc-bookmarks-webapp to crates.io..."
cargo publish -p dkdc-bookmarks-webapp
crate_version_exists() {
local crate="$1"
curl -fsSL "https://crates.io/api/v1/crates/${crate}/versions" \
| jq -e --arg version "$version" '.versions[] | select(.num == $version and (.yanked | not))' >/dev/null
}

echo "Publishing dkdc-bookmarks-app to crates.io..."
cargo publish -p dkdc-bookmarks-app
wait_for_crate_version() {
local crate="$1"
for _ in {1..12}; do
if crate_version_exists "$crate"; then
return 0
fi
sleep 10
done
echo "${crate} ${version} was not visible on crates.io after publishing" >&2
return 1
}

echo "Publishing dkdc-bookmarks to crates.io..."
cargo publish -p dkdc-bookmarks
publish_crate() {
local crate="$1"
if crate_version_exists "$crate"; then
echo "${crate} ${version} already exists on crates.io, skipping publish"
else
echo "Publishing ${crate} ${version} to crates.io..."
cargo publish -p "$crate"
fi
wait_for_crate_version "$crate"
}

publish_crate dkdc-bookmarks-core
publish_crate dkdc-bookmarks-webapp
publish_crate dkdc-bookmarks-app
publish_crate dkdc-bookmarks

echo "Published!"
6 changes: 3 additions & 3 deletions crates/bookmarks-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dkdc-bookmarks-app"
version = "0.5.0"
version = "0.5.1"
edition = "2024"
authors = ["Cody <cody@dkdc.io>"]
description = "Tauri desktop shell for bookmarks"
Expand All @@ -15,8 +15,8 @@ path = "src/lib.rs"

[dependencies]
anyhow = "1"
dkdc-bookmarks-core = { version = "0.5.0", path = "../bookmarks-core" }
dkdc-bookmarks-webapp = { version = "0.5.0", path = "../bookmarks-webapp" }
dkdc-bookmarks-core = { version = "0.5.1", path = "../bookmarks-core" }
dkdc-bookmarks-webapp = { version = "0.5.1", path = "../bookmarks-webapp" }
open = "5"
tauri = "2.11.1"

Expand Down
1 change: 1 addition & 0 deletions crates/bookmarks-app/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/bookmarks-app/gen/schemas/capabilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"default":{"identifier":"default","description":"Default bookmarks desktop app capability.","local":true,"windows":["main"],"permissions":["core:default"]}}
Loading
Loading