Skip to content

Commit 08ca1ba

Browse files
.github: change workflow cargo patching
1 parent 1362f0f commit 08ca1ba

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/tock-build.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
push:
66
branches: ["**"] # any branch push
77
pull_request:
8-
branches: [main] # merges into main
8+
branches: [main] # PRs into main
99
schedule:
10-
- cron: "0 6 * * *" # nightly (6 AM UTC)
10+
- cron: "0 6 * * *" # nightly
1111
workflow_dispatch:
1212

1313
jobs:
@@ -70,27 +70,33 @@ jobs:
7070
git submodule update --init --recursive
7171
7272
# -------------------------------------------------
73-
# Variant 1: Use CURRENT CI branch (most important)
74-
# BEST for pushes to feature branches
73+
# Variant 1: Use CURRENT CI branch (local checkout)
7574
# -------------------------------------------------
76-
- name: Patch abacus_registers -> local checkout (CI branch)
75+
- name: Patch abacus_registers -> local CI checkout
7776
if: matrix.source == 'ci-branch'
7877
run: |
79-
echo "Using local abacus-registers checkout (branch: ${GITHUB_REF_NAME})"
8078
cd tock
81-
printf '\n[patch.crates-io]\n' >> Cargo.toml
82-
printf 'abacus_registers = { path = "../" }\n' >> Cargo.toml
79+
mkdir -p .cargo
80+
printf '%s\n' \
81+
'[patch.crates-io]' \
82+
'abacus_registers = { path = "../" }' \
83+
'' \
84+
'[patch."https://github.com/abacus-rs/abacus-registers"]' \
85+
'abacus_registers = { path = "../" }' \
86+
> .cargo/config.toml
8387
8488
# -------------------------------------------------
8589
# Variant 2: Force main branch of abacus_registers
86-
# Used for PRs + nightly
8790
# -------------------------------------------------
8891
- name: Patch abacus_registers -> git main
8992
if: matrix.source == 'main'
9093
run: |
9194
cd tock
92-
printf '\n[patch."https://github.com/abacus-rs/abacus-registers"]\n' >> Cargo.toml
93-
printf 'abacus_registers = { git = "https://github.com/abacus-rs/abacus-registers", branch = "main" }\n' >> Cargo.toml
95+
mkdir -p .cargo
96+
printf '%s\n' \
97+
'[patch."https://github.com/abacus-rs/abacus-registers"]' \
98+
'abacus_registers = { git = "https://github.com/abacus-rs/abacus-registers", branch = "main" }' \
99+
> .cargo/config.toml
94100
95101
# -------------------------------------------------
96102
# Variant 3: crates.io (disabled until published)
@@ -99,8 +105,11 @@ jobs:
99105
if: matrix.source == 'crate'
100106
run: |
101107
cd tock
102-
printf '\n[patch.crates-io]\n' >> Cargo.toml
103-
printf 'abacus_registers = { version = "*" }\n' >> Cargo.toml
108+
mkdir -p .cargo
109+
printf '%s\n' \
110+
'[patch.crates-io]' \
111+
'abacus_registers = { version = "*" }' \
112+
> .cargo/config.toml
104113
105114
- name: Show resolved abacus source
106115
run: |

0 commit comments

Comments
 (0)