Repository: zng-ui/zng (language: rust)

Issue:
Release workflow optional inputs not working
`release.yml`

Always skips even when not flagged to skip.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4656a92c5..fa862c9b8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,21 +27,19 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_checks }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do version --verbose
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do fmt --check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo clean # to print size
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo check --examples --tests --release
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
   check-windows:
     runs-on: windows-latest
     env:
@@ -49,40 +47,36 @@ jobs:
       CXX: 'clang-cl'
     steps:
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_checks }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do version --verbose
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do fmt --check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do clean
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo check --examples --tests --release
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
   check-macos:
     runs-on: macos-13
     steps:
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_checks }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do version --verbose
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do fmt --check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do check
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo do clean
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo check --examples --tests --release
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_checks }}
+        if: ${{ github.event.inputs.skip_checks != 'true' }}
 
   prebuild-ubuntu:
     runs-on: ubuntu-latest
@@ -116,8 +110,6 @@ jobs:
           echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
 
       - uses: actions/checkout@v4
-        with:
-          ref: release
       - run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
       - name: cargo do prebuild --features avif
         env:
@@ -171,8 +163,6 @@ jobs:
           ninja -C build install
 
       - uses: actions/checkout@v4
-        with:
-          ref: release
       - run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
       - name: cargo do prebuild --features avif
         env:
@@ -217,8 +207,6 @@ jobs:
           echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
           echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
       - uses: actions/checkout@v4
-        with:
-          ref: release
       - run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
       - name: cargo do prebuild --features avif
         env:
@@ -237,8 +225,6 @@ jobs:
     needs: [check-ubuntu]
     steps:
       - uses: actions/checkout@v4
-        with:
-          ref: release
       - run: cargo do doc
       - uses: actions/upload-artifact@v4
         with:
@@ -251,32 +237,30 @@ jobs:
     needs: [prebuild-ubuntu]
     steps:
       - name: install cargo-nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: taiki-e/install-action@v2
         with:
           tool: cargo-nextest
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_tests }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - name: install prebuilt
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: actions/download-artifact@v4
         with:
           name: prebuilt-ubuntu
           path: crates/zng-view-prebuilt/lib
       - run: cargo do test --lib --bins --tests --nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --doc
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --macro --all
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
   test-windows:
     runs-on: windows-latest
     needs: [prebuild-windows]
@@ -286,32 +270,30 @@ jobs:
       NEXTEST_RETRIES: 3
     steps:
       - name: install cargo-nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: taiki-e/install-action@v2
         with:
           tool: cargo-nextest
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_tests }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - name: install prebuilt
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: actions/download-artifact@v4
         with:
           name: prebuilt-windows
           path: crates/zng-view-prebuilt/lib
       - run: cargo do test --lib --bins --tests --nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --doc
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --macro --all
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
   test-macos:
     runs-on: macos-13
     needs: [prebuild-macos]
@@ -319,47 +301,43 @@ jobs:
       NEXTEST_RETRIES: 3
     steps:
       - name: install cargo-nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: taiki-e/install-action@v2
         with:
           tool: cargo-nextest
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_tests }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - name: install prebuilt
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
         uses: actions/download-artifact@v4
         with:
           name: prebuilt-macos
           path: crates/zng-view-prebuilt/lib
       - run: cargo do test --lib --bins --tests --nextest
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --doc
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do test --macro --all
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo clean
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
 
   test-cargo-publish:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
-        if: ${{ !github.event.inputs.skip_tests }}
-        with:
-          ref: release
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
       - run: cargo do publish --test
-        if: ${{ !github.event.inputs.skip_tests }}
+        if: ${{ github.event.inputs.skip_tests != 'true' }}
 
   tag:
     runs-on: ubuntu-latest
     needs: [test-ubuntu, test-windows, test-macos, test-cargo-publish, doc-ubuntu]
-    if: ${{ github.event.inputs.cancel_tag == '' || github.event.inputs.cancel_tag == 'false' }}
+    if: ${{ github.event.inputs.cancel_tag != 'true' && github.event.ref == 'refs/heads/release' }}
     permissions:
       contents: write
     outputs:
@@ -368,7 +346,6 @@ jobs:
       - uses: actions/checkout@v4
         with:
           fetch-depth: 0
-          ref: release
       - id: publish_version_tag
         run: cargo do publish_version_tag --execute | tail -n 1 >> "$GITHUB_OUTPUT"
   
@@ -435,8 +412,6 @@ jobs:
       CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
     steps:
       - uses: actions/checkout@v4
-        with:
-          ref: release
       - run: cargo do publish --execute ${{ github.run_attempt > 1 && '--no-burst' || '' }}
 
   cleanup:
diff --git a/tools/do-tasks/src/main.rs b/tools/do-tasks/src/main.rs
index 9551ece05..16bb40de7 100644
--- a/tools/do-tasks/src/main.rs
+++ b/tools/do-tasks/src/main.rs
@@ -877,10 +877,12 @@ fn publish(mut args: Vec<&str>) {
                 }
             }
 
-            let name = line.split('/').next().unwrap();
-            if members.iter().any(|m| m.name == name) {
-                let changes: &mut Vec<&str> = changed.entry(name).or_default();
-                changes.push(line);
+            if let Some(name) = line.strip_prefix("crates/") {
+                let name = name.split('/').next().unwrap();
+                if members.iter().any(|m| m.name == name) {
+                    let changes: &mut Vec<&str> = changed.entry(name).or_default();
+                    changes.push(line);
+                }
             }
         }
 
diff --git a/tools/do-tasks/src/util.rs b/tools/do-tasks/src/util.rs
index 4fbd5fe8c..7a3d5b96f 100644
--- a/tools/do-tasks/src/util.rs
+++ b/tools/do-tasks/src/util.rs
@@ -484,40 +484,10 @@ pub fn git_tag_exists(tag: &str) -> bool {
     output.lines().any(|l| l == tag)
 }
 
-pub fn workspace_members() -> Vec<String> {
-    match std::fs::read_to_string("Cargo.toml") {
-        Ok(file) => {
-            let mut members = vec![];
-
-            let mut started = false;
-            for line in file.lines() {
-                if !started {
-                    if line.starts_with("members =") {
-                        started = true;
-                    }
-                } else if line.starts_with("]") {
-                    break;
-                } else if line.contains('"') && !line.contains('#') {
-                    let line = line.trim().trim_matches(&['"', ',']);
-                    if !line.is_empty() {
-                        members.push(line.to_owned());
-                    }
-                }
-            }
-
-            members
-        }
-        Err(e) => {
-            error(e);
-            vec![]
-        }
-    }
-}
-
 pub fn publish_members() -> Vec<PublishMember> {
     let mut members = vec![];
-    'members: for member in workspace_members() {
-        match std::fs::read_to_string(PathBuf::from(member).join("Cargo.toml")) {
+    'members: for member in top_cargo_toml("crates") {
+        match std::fs::read_to_string(member) {
             Ok(file) => {
                 let mut member = PublishMember {
                     name: String::new(),
@@ -662,7 +632,7 @@ impl PublishMember {
 
         use std::fmt::Write as _;
 
-        let cargo_path = PathBuf::from(&self.name).join("Cargo.toml");
+        let cargo_path = PathBuf::from("crates").join(&self.name).join("Cargo.toml");
         let cargo = std::fs::read_to_string(&cargo_path).expect("failed to load Cargo.toml");
         let mut output = String::with_capacity(cargo.len());
 


Test patch: