Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 28 additions & 0 deletions .github/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"
36 changes: 28 additions & 8 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,15 @@ jobs:
run: |
rustup toolchain install nightly

- name: Resolve Makepad revision
id: makepad
shell: bash
run: |
bash ./.github/scripts/resolve-makepad-rev.sh >> "$GITHUB_OUTPUT"

- 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
cargo install --force --git "${{ steps.makepad.outputs.repo }}" --rev "${{ steps.makepad.outputs.rev }}" cargo-makepad

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

- name: Resolve Makepad revision
id: makepad
shell: bash
run: |
bash ./.github/scripts/resolve-makepad-rev.sh >> "$GITHUB_OUTPUT"

- 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
cargo install --force --git "${{ steps.makepad.outputs.repo }}" --rev "${{ steps.makepad.outputs.rev }}" cargo-makepad

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

- name: Resolve Makepad revision
id: makepad
shell: bash
run: |
bash ./.github/scripts/resolve-makepad-rev.sh >> "$GITHUB_OUTPUT"

- 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
cargo install --force --git "${{ steps.makepad.outputs.repo }}" --rev "${{ steps.makepad.outputs.rev }}" cargo-makepad

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

- name: Resolve Makepad revision
id: makepad
shell: bash
run: |
bash ./.github/scripts/resolve-makepad-rev.sh >> "$GITHUB_OUTPUT"

- 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
cargo install --force --git "${{ steps.makepad.outputs.repo }}" --rev "${{ steps.makepad.outputs.rev }}" cargo-makepad

- name: Install Android toolchain
run: |
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ 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.
## !NOTE! CI installs cargo-makepad using the exact Makepad revision resolved in Cargo.lock.
## !!!!!! Updating the makepad dependency should update Cargo.lock; no manual edits in builds.yml.
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