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: 19 additions & 0 deletions .github/actions/setup-cargo-makepad/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup cargo-makepad
description: Resolve Makepad revision from Cargo.lock and install cargo-makepad.
inputs:
lockfile:
description: Path to Cargo.lock
required: false
default: Cargo.lock
runs:
using: composite
steps:
- name: Resolve Makepad revision
id: makepad
shell: bash
run: |
bash "$GITHUB_ACTION_PATH/scripts/resolve-makepad-rev.sh" "${{ inputs.lockfile }}" >> "$GITHUB_OUTPUT"
- name: Install cargo-makepad
shell: bash
run: |
cargo install --force --git "${{ steps.makepad.outputs.repo }}" --rev "${{ steps.makepad.outputs.rev }}" cargo-makepad
28 changes: 28 additions & 0 deletions .github/actions/setup-cargo-makepad/scripts/resolve-makepad-rev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail

lockfile="${1:-Cargo.lock}"

source_line="$(
awk '
$1 == "name" && $3 == "\"makepad-widgets\"" { in_pkg = 1; next }
in_pkg && $1 == "source" { print $3; exit }
in_pkg && $1 == "[[package]]" { in_pkg = 0 }
' "$lockfile"
)"

if [[ -z "$source_line" ]]; then
echo "error=makepad-widgets source not found in $lockfile" >&2
exit 1
fi

source_line="${source_line%\"}"
source_line="${source_line#\"}"
source_line="${source_line#git+}"

rev="${source_line##*#}"
repo_with_query="${source_line%#*}"
repo="${repo_with_query%%\?*}"

printf 'repo=%s\n' "$repo"
printf 'rev=%s\n' "$rev"
24 changes: 8 additions & 16 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ jobs:
run: |
rustup toolchain install nightly

- name: Install cargo-makepad
# The git repo and branch MUST MATCH the `makepad-widgets` dependency defined in `Cargo.toml`.
run: |
cargo install --force --git https://github.com/kevinaboos/makepad.git --branch serde_optional cargo-makepad
- name: Setup cargo-makepad
uses: ./.github/actions/setup-cargo-makepad

- name: Install iOS toolchain
run: |
Expand Down Expand Up @@ -209,10 +207,8 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install cargo-makepad
# The git repo and branch MUST MATCH the `makepad-widgets` dependency defined in `Cargo.toml`.
run: |
cargo install --force --git https://github.com/kevinaboos/makepad.git --branch serde_optional cargo-makepad
- name: Setup cargo-makepad
uses: ./.github/actions/setup-cargo-makepad

- name: Install Android toolchain
run: |
Expand All @@ -239,10 +235,8 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install cargo-makepad
# The git repo and branch MUST MATCH the `makepad-widgets` dependency defined in `Cargo.toml`.
run: |
cargo install --force --git https://github.com/kevinaboos/makepad.git --branch serde_optional cargo-makepad
- name: Setup cargo-makepad
uses: ./.github/actions/setup-cargo-makepad

- name: Install Android toolchain
run: |
Expand Down Expand Up @@ -274,10 +268,8 @@ jobs:
with:
key: android-windows-build-${{ hashFiles('Cargo.lock') }}

- name: Install cargo-makepad
# The git repo and branch MUST MATCH the `makepad-widgets` dependency defined in `Cargo.toml`.
run: |
cargo install --force --git https://github.com/kevinaboos/makepad.git --branch serde_optional cargo-makepad
- name: Setup cargo-makepad
uses: ./.github/actions/setup-cargo-makepad

- name: Install Android toolchain
run: |
Expand Down
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ version = "0.0.1-pre-alpha-4"
metadata.makepad-auto-version = "zqpv-Yj-K7WNVK2I8h5Okhho46Q="

[dependencies]
## !NOTE! When updating the makepad dependency, be sure to also change the repo and branch
## !!!!!! that are used in `builds.yml` for installing cargo makepad from git.
## !!!!!! The version (git repo + branch) installed in CI actions should the one defined here.
makepad-widgets = { git = "https://github.com/kevinaboos/makepad", branch = "serde_optional", features = ["serde"] }
# makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "dev", features = ["serde"] }

Expand Down