From d5ed3b165f5a7e2dd20e46a34cac3ba5fc75978e Mon Sep 17 00:00:00 2001 From: GroM Date: Thu, 7 Dec 2023 12:17:35 +0100 Subject: [PATCH] only trigger cargo publish dry-run manually --- .github/workflows/publish.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a35108b9..e02e0e28 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,13 +4,12 @@ on: push: tags: - '*-v*.*.*' # Match tags like 'package1-v1.2.3' - pull_request: workflow_dispatch: # Allow manual workflow dispatch jobs: test-dry-run: runs-on: ubuntu-latest - if: github.event_name != 'push' # Only run this job for pull requests and manual triggers + if: github.event_name == 'workflow_dispatch' # Only run this job for manual triggers steps: - name: Checkout Code @@ -25,9 +24,8 @@ jobs: - name: Retrieve Package Names from workspace root id: get-root-packages run: | - # Retrieve package names from the workspace root using cargo metadata and jq - # PACKAGE_NAMES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | tr '\n' ' ') - PACKAGE_NAMES="include_gif testmacro ledger_secure_sdk_sys ledger_device_sdk" + # Retrieve package names from the workspace root + PACKAGE_NAMES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | tr '\n' ' ') # Set the package names as an output echo "Package names from root Cargo.toml: $PACKAGE_NAMES" @@ -37,7 +35,7 @@ jobs: - name: Test Dry-Run Publish for Each Package run: | - # Iterate through package names retrieved from the root Cargo.toml + # Iterate through package names retrieved PACKAGE_NAMES="${{ steps.get-root-packages.outputs.package-names }}" for PACKAGE_NAME in $PACKAGE_NAMES; do # Test a dry-run publish for each package within the workspace