Skip to content
Merged
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
23 changes: 21 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ 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
runs-on: ubuntu-latest
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 }}

Expand All @@ -37,4 +49,11 @@ jobs:

- run: npm install

- run: npm publish
- 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
Loading