From c6dd6cf43d03ef8092e710c2f547165a0e563576 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:12:04 +1000 Subject: [PATCH 01/16] Make publish-dry-run-v2 work without a list of crates and deprecate v1 --- .github/workflows/rust-publish-dry-run-v2.yml | 29 ++++++- .github/workflows/rust-publish-dry-run.yml | 76 ++----------------- 2 files changed, 35 insertions(+), 70 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 73f2038..048fd9f 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -5,7 +5,7 @@ on: inputs: crates: description: 'Space separated list of crate names in the order to be published.' - required: true + required: false type: string runs-on: required: false @@ -65,6 +65,16 @@ jobs: name: cargo-hack version: 0.5.28 + - uses: stellar/binaries@v25 + with: + name: cargo-workspaces + version: 0.2.35 + + # Create the vendor directory because it'll only be created in the next step + # if the crate has dependencies, but it's needed for the latter steps in all + # cases. + - run: mkdir -p vendor + # Vendor all the dependencies into the vendor/ folder. Temporarily remove # [patch.crates-io] entries in the workspace Cargo.toml that reference git # repos. These will be removed when published. @@ -76,6 +86,23 @@ jobs: rm Cargo.toml mv Cargo.toml.bak Cargo.toml + # If a list of crates weren't provided, prepare a list by asking + # cargo-workspaces for the order it would publish the crates in, and filter + # the list of returned crates by crates that are marked for publishing. + - name: Prepare List of Crates Ordered by Publish-Order + if: inputs.crates == '' + run: | + echo "CRATES=\"$( \ + cargo workspaces exec --no-bail \ + sh -c ' \ + name=$(basename $(pwd)); \ + cargo metadata --format-version 1 --no-deps \ + | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' \ + | grep -w -q $name \ + && echo $name \ + ' \ + )\"" >> $GITHUB_ENV + # Package the crates that will be published. Verification is disabled # because we aren't ready to verify yet. Add each crate that was packaged to # the vendor/ directory. diff --git a/.github/workflows/rust-publish-dry-run.yml b/.github/workflows/rust-publish-dry-run.yml index 70c7bd3..0bb7588 100644 --- a/.github/workflows/rust-publish-dry-run.yml +++ b/.github/workflows/rust-publish-dry-run.yml @@ -1,9 +1,6 @@ -# WARNING: This publish dry run process will not work on repositories that have -# a crate containing bin targets that are dependent on other crates in the -# repository. Please use `rust-publish-dry-run-v2` for any repository containing -# binaries. +# Deprecated. Use publish-dry-run-v2.yml. # -# For more details, see https://github.com/rust-lang/cargo/issues/11181. +# This workflow calls through to the v2 workflow. name: Publish Dry Run @@ -26,67 +23,8 @@ on: jobs: publish-dry-run: - runs-on: ${{ inputs.runs-on }} - defaults: - run: - shell: bash - env: - CARGO_BUILD_TARGET: ${{ inputs.target }} - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - steps: - - uses: actions/checkout@v3 - - - uses: stellar/actions/rust-cache@main - - - run: rustup update - - run: rustup target add ${{ inputs.target }} - - if: inputs.target == 'aarch64-unknown-linux-gnu' - run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - - uses: stellar/binaries@v21 - with: - name: cargo-hack - version: 0.5.28 - - # Create the vendor directory because it'll only be created in the next step - # if the crate has dependencies, but it's needed for the latter steps in all - # cases. - - run: mkdir -p vendor - - # Vendor all the dependencies into the vendor/ folder. Temporarily remove - # [patch.crates-io] entries in the workspace Cargo.toml that reference git - # repos. These will be removed when published. - - run: | - cp Cargo.toml Cargo.toml.bak - sed -r '/(git|rev) ?=/d' Cargo.toml.bak > Cargo.toml - cargo vendor --versioned-dirs - rm Cargo.toml - mv Cargo.toml.bak Cargo.toml - - # Package the crates that will be published. Verification is disabled because - # we aren't ready to verify yet. - - run: cargo-hack hack --ignore-private package --no-verify ${{ inputs.cargo-package-options }} - - # Add each crate that was packaged to the vendor/ directory. - - run: | - for crate in target/package/*.crate - do - name=$(basename "$crate" .crate) - tar xvfz "$crate" -C vendor/ - # Crates in the vendor directory require a checksum file, but it doesn't - # matter if it is empty. - echo '{"files":{}}' > vendor/$name/.cargo-checksum.json - done - - # Rerun the package command but with verification enabled this time. Tell - # cargo to use the local vendor/ directory as the source for all packages. Run - # the package command on the full feature powerset so that all features of - # each crate are verified to compile. - - run: > - cargo-hack hack - ${{ inputs.cargo-hack-feature-options }} - --ignore-private - --config "source.crates-io.replace-with = 'vendored-sources'" - --config "source.vendored-sources.directory = 'vendor'" - package - --target ${{ inputs.target }} + uses: ./.github/workflows/rust-publish-dry-run-v2.yml + with: + runs-on: ${{ inputs.runs-on }} + target: ${{ inputs.target }} + cargo-hack-feature-options: ${{ inputs.cargo-hack-feature-options }} From 0d3bfd9e25b3322dbb9d984fa4621476cd415d05 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:29:20 +1000 Subject: [PATCH 02/16] replace new lines with spaces --- .github/workflows/rust-publish-dry-run-v2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 048fd9f..e134bd4 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -92,7 +92,7 @@ jobs: - name: Prepare List of Crates Ordered by Publish-Order if: inputs.crates == '' run: | - echo "CRATES=\"$( \ + echo "CRATES=\""${$( \ cargo workspaces exec --no-bail \ sh -c ' \ name=$(basename $(pwd)); \ @@ -101,7 +101,7 @@ jobs: | grep -w -q $name \ && echo $name \ ' \ - )\"" >> $GITHUB_ENV + )//$'\n'/ }\"" >> $GITHUB_ENV # Package the crates that will be published. Verification is disabled # because we aren't ready to verify yet. Add each crate that was packaged to From e6894793db0493b331dacd66cd036bd569e60929 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:31:32 +1000 Subject: [PATCH 03/16] try --- .github/workflows/rust-publish-dry-run-v2.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index e134bd4..651a38d 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -91,16 +91,16 @@ jobs: # the list of returned crates by crates that are marked for publishing. - name: Prepare List of Crates Ordered by Publish-Order if: inputs.crates == '' - run: | - echo "CRATES=\""${$( \ - cargo workspaces exec --no-bail \ - sh -c ' \ - name=$(basename $(pwd)); \ - cargo metadata --format-version 1 --no-deps \ - | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' \ - | grep -w -q $name \ - && echo $name \ - ' \ + run: > + echo "CRATES=\""${$( + cargo workspaces exec --no-bail + sh -c ' + name=$(basename $(pwd)); + cargo metadata --format-version 1 --no-deps + | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' + | grep -w -q $name + && echo $name + ' )//$'\n'/ }\"" >> $GITHUB_ENV # Package the crates that will be published. Verification is disabled From 5643cadaa216e67473d726463c4ed5fee755fb18 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:33:31 +1000 Subject: [PATCH 04/16] try --- .github/workflows/rust-publish-dry-run-v2.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 651a38d..51b3386 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -91,17 +91,7 @@ jobs: # the list of returned crates by crates that are marked for publishing. - name: Prepare List of Crates Ordered by Publish-Order if: inputs.crates == '' - run: > - echo "CRATES=\""${$( - cargo workspaces exec --no-bail - sh -c ' - name=$(basename $(pwd)); - cargo metadata --format-version 1 --no-deps - | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' - | grep -w -q $name - && echo $name - ' - )//$'\n'/ }\"" >> $GITHUB_ENV + run: echo "CRATES=\""${$(cargo workspaces exec --no-bail sh -c 'name=$(basename $(pwd)); cargo metadata --format-version 1 --no-deps | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' | grep -w -q $name && echo $name')//$'\n'/ }\"" >> $GITHUB_ENV # Package the crates that will be published. Verification is disabled # because we aren't ready to verify yet. Add each crate that was packaged to From ae2454d806458fb574917a993d45e5f614a48754 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:27:32 +1000 Subject: [PATCH 05/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 51b3386..6ce00ce 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -89,16 +89,26 @@ jobs: # If a list of crates weren't provided, prepare a list by asking # cargo-workspaces for the order it would publish the crates in, and filter # the list of returned crates by crates that are marked for publishing. + # '); cargo metadata --format-version 1 --no-deps | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' | grep -w -q $name && echo $name''); - name: Prepare List of Crates Ordered by Publish-Order - if: inputs.crates == '' - run: echo "CRATES=\""${$(cargo workspaces exec --no-bail sh -c 'name=$(basename $(pwd)); cargo metadata --format-version 1 --no-deps | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' | grep -w -q $name && echo $name')//$'\n'/ }\"" >> $GITHUB_ENV + run: echo "CRATES=\""${$()//$'\n'/ }\"" >> $GITHUB_ENV + - uses: actions/github-script@v7 + id: crates + with: + script: | + const exec = require("@actions/exec"); + let crates = await exec.exec("cargo workspaces exec --no-bail sh -c 'basename $(pwd)'"); + return crates; + result-encoding: string + - name: List of Crates + run: echo "${{steps.crates.outputs.result}}" # Package the crates that will be published. Verification is disabled # because we aren't ready to verify yet. Add each crate that was packaged to # the vendor/ directory. - - name: Package Crates ${{ inputs.crates }} + - name: Package Crates ${{ steps.crates.outputs.result }} run: | - for name in ${{ inputs.crates }} + for name in ${{ steps.crates.outputs.result }} do version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name=="'$name'") | .version') cargo package \ From 25a734c0262793ed28ae1724783e7456cf9293b9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:29:14 +1000 Subject: [PATCH 06/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 6ce00ce..23b77d7 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -91,8 +91,7 @@ jobs: # the list of returned crates by crates that are marked for publishing. # '); cargo metadata --format-version 1 --no-deps | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' | grep -w -q $name && echo $name''); - name: Prepare List of Crates Ordered by Publish-Order - run: echo "CRATES=\""${$()//$'\n'/ }\"" >> $GITHUB_ENV - - uses: actions/github-script@v7 + uses: actions/github-script@v7 id: crates with: script: | From cf3ed9c26a5fc74581c21e59a5c49bc52a6011f1 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:37:08 +1000 Subject: [PATCH 07/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 23b77d7..461fc72 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -95,7 +95,6 @@ jobs: id: crates with: script: | - const exec = require("@actions/exec"); let crates = await exec.exec("cargo workspaces exec --no-bail sh -c 'basename $(pwd)'"); return crates; result-encoding: string From 358cba6ea08229721224c3004232a2e45aab4f45 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:39:54 +1000 Subject: [PATCH 08/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 461fc72..c3784fa 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -95,7 +95,7 @@ jobs: id: crates with: script: | - let crates = await exec.exec("cargo workspaces exec --no-bail sh -c 'basename $(pwd)'"); + let crates = await exec.exec("cargo", ["workspaces", "exec", "--no-bail", "sh", "-c", "basename $(pwd)"]); return crates; result-encoding: string - name: List of Crates From ea9aa88cafaafeea23cf3a71c89db1822bcfc022 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:44:28 +1000 Subject: [PATCH 09/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index c3784fa..0b5fb46 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -95,7 +95,23 @@ jobs: id: crates with: script: | - let crates = await exec.exec("cargo", ["workspaces", "exec", "--no-bail", "sh", "-c", "basename $(pwd)"]); + let crates = ""; + await exec.exec( + "cargo", + [ + "workspaces", + "exec", + "--no-bail", + "sh", + "-c", + "basename $(pwd)", + ], + { + listeners: { + stdout: (data: Buffer) => { crates += data.toString(); }, + }, + }, + ); return crates; result-encoding: string - name: List of Crates From 818487026fb264b9a12ecf587a9e4d6018ae7287 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:45:48 +1000 Subject: [PATCH 10/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 0b5fb46..c1b1b1b 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -108,7 +108,7 @@ jobs: ], { listeners: { - stdout: (data: Buffer) => { crates += data.toString(); }, + stdout: (data) => { crates += data.toString(); }, }, }, ); From 02d0bb8e0ce346fa93412319b8655f5524b1187c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:50:06 +1000 Subject: [PATCH 11/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index c1b1b1b..c870999 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -95,24 +95,14 @@ jobs: id: crates with: script: | - let crates = ""; + let crates_list = ""; await exec.exec( "cargo", - [ - "workspaces", - "exec", - "--no-bail", - "sh", - "-c", - "basename $(pwd)", - ], - { - listeners: { - stdout: (data) => { crates += data.toString(); }, - }, - }, + [ "workspaces", "exec", "--no-bail", "sh", "-c", "basename $(pwd)" ], + { listeners: { stdout: (buf) => { crates_list += buf.toString(); } } }, ); - return crates; + let crates = crates_list.split("\n"); + return crates.join(" "); result-encoding: string - name: List of Crates run: echo "${{steps.crates.outputs.result}}" From 8845ba6df5d680ec8e778ef782fa889036ebbe31 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:06:47 +1000 Subject: [PATCH 12/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index c870999..53f71c7 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -95,14 +95,26 @@ jobs: id: crates with: script: | - let crates_list = ""; + // Get list of crates in publish order. + let crates_str = ""; await exec.exec( - "cargo", - [ "workspaces", "exec", "--no-bail", "sh", "-c", "basename $(pwd)" ], - { listeners: { stdout: (buf) => { crates_list += buf.toString(); } } }, + "cargo", [ "workspaces", "exec", "--no-bail", "sh", "-c", "basename $(pwd)" ], + { listeners: { stdout: (buf) => { crates_str += buf.toString(); } } }, ); - let crates = crates_list.split("\n"); - return crates.join(" "); + let crates = crates_str.split("\n"); + + // Get cargo metadata. + let metadata_str = ""; + await exec.exec( + "cargo", [ "metadata", "--format-version=1", "--no-deps" ], + { listeners: { stdout: (buf) => { metadata_str += buf.toString(); } } }, + ); + let metadata = JSON.parse(metadata_str); + + // Filter the crates to those that publish. + let crates_that_publish = crates.filter((c) => metadata.packages.find((p) => p.name == c).publish !== []); + + return crates_that_publish.join(" "); result-encoding: string - name: List of Crates run: echo "${{steps.crates.outputs.result}}" From 58b535a08caf377d828b12311dbe26d032deec0b Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:10:15 +1000 Subject: [PATCH 13/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 53f71c7..ca9d023 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -112,7 +112,7 @@ jobs: let metadata = JSON.parse(metadata_str); // Filter the crates to those that publish. - let crates_that_publish = crates.filter((c) => metadata.packages.find((p) => p.name == c).publish !== []); + let crates_that_publish = crates.filter((c) => metadata.packages.some((p) => p.name == c && p.publish !== [])); return crates_that_publish.join(" "); result-encoding: string From 5dced276f9a3086e1006517ab6bf68909b191842 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:55:49 +1000 Subject: [PATCH 14/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index ca9d023..5a3a053 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -103,18 +103,18 @@ jobs: ); let crates = crates_str.split("\n"); - // Get cargo metadata. - let metadata_str = ""; + // Get list of crates that need publishing, but out of order. + let crates_need_publish_str = ""; await exec.exec( - "cargo", [ "metadata", "--format-version=1", "--no-deps" ], - { listeners: { stdout: (buf) => { metadata_str += buf.toString(); } } }, + "cargo", [ "workspaces", "list" ], + { listeners: { stdout: (buf) => { crates_need_publish_str += buf.toString(); } } }, ); - let metadata = JSON.parse(metadata_str); + let crates_need_publish = crates_need_publish_str.split("\n"); // Filter the crates to those that publish. - let crates_that_publish = crates.filter((c) => metadata.packages.some((p) => p.name == c && p.publish !== [])); + let crates_to_publish = crates.filter((c) => crates_to_publish.includes(c)); - return crates_that_publish.join(" "); + return crates_to_publish.join(" "); result-encoding: string - name: List of Crates run: echo "${{steps.crates.outputs.result}}" From c4617971b20443b733346029b25e59877c977d1f Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:59:46 +1000 Subject: [PATCH 15/16] wip --- .github/workflows/rust-publish-dry-run-v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 5a3a053..32a7aff 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -112,7 +112,7 @@ jobs: let crates_need_publish = crates_need_publish_str.split("\n"); // Filter the crates to those that publish. - let crates_to_publish = crates.filter((c) => crates_to_publish.includes(c)); + let crates_to_publish = crates.filter((c) => crates_need_publish.includes(c)); return crates_to_publish.join(" "); result-encoding: string From 1f3c324bab062100b7e6cb51aebc9e28659f21a3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:07:00 +1000 Subject: [PATCH 16/16] it works --- .github/workflows/rust-publish-dry-run-v2.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust-publish-dry-run-v2.yml b/.github/workflows/rust-publish-dry-run-v2.yml index 32a7aff..14fe412 100644 --- a/.github/workflows/rust-publish-dry-run-v2.yml +++ b/.github/workflows/rust-publish-dry-run-v2.yml @@ -89,7 +89,6 @@ jobs: # If a list of crates weren't provided, prepare a list by asking # cargo-workspaces for the order it would publish the crates in, and filter # the list of returned crates by crates that are marked for publishing. - # '); cargo metadata --format-version 1 --no-deps | jq -r '"'"'.packages[] | select(.publish != []) | .name'"'"' | grep -w -q $name && echo $name''); - name: Prepare List of Crates Ordered by Publish-Order uses: actions/github-script@v7 id: crates