From e998c771108d301cb40743b5eb1d6262d09a61d1 Mon Sep 17 00:00:00 2001 From: cristipufu Date: Fri, 16 Oct 2026 17:22:37 +0300 Subject: [PATCH] ci: install Tauri's Linux libraries before publishing the crate `cargo publish` builds the crate before uploading it, and the release job didn't install the GTK/WebKit libraries that ci.yml installs, so the 1.3.0 publish failed building glib-sys. Each publish job now also skips a version its registry already has, so publishing a release again retries only what failed (npm 0.7.0 went out with 1.3.0; the crate didn't). Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/release.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 138fe56..e4e9764 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,8 @@ on: release: types: [published] +# Publishing a release again retries it: each job skips a version its registry already has. + jobs: publish-crates: name: Publish to crates.io @@ -11,10 +13,20 @@ jobs: steps: - uses: actions/checkout@v7 + # cargo publish builds the crate before uploading it, and Tauri needs these on Linux. + - name: Install system dependencies + run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libglib2.0-dev + - uses: dtolnay/rust-toolchain@stable - name: Publish - run: cargo publish + run: | + version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') + if curl -sf -A "tauri-plugin-aptabase release" "https://crates.io/api/v1/crates/tauri-plugin-aptabase/$version" > /dev/null; then + echo "tauri-plugin-aptabase $version is already on crates.io" + else + cargo publish + fi env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} @@ -37,4 +49,11 @@ jobs: - run: npm install - - run: npm publish \ No newline at end of file + - name: Publish + run: | + version=$(node -p "require('./package.json').version") + if [ "$(npm view "@aptabase/tauri@$version" version 2>/dev/null)" = "$version" ]; then + echo "@aptabase/tauri $version is already on npm" + else + npm publish + fi