Skip to content

Commit

Permalink
only trigger cargo publish dry-run manually
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Dec 7, 2023
1 parent 14dfebc commit d5ed3b1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit d5ed3b1

Please sign in to comment.