From ddd3d1d811ea76228e0876e2c5c52e100883e7f5 Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Thu, 19 Sep 2024 11:16:58 -0400 Subject: [PATCH] ci: add `dry-run` option to python actions Signed-off-by: Yuki Kishimoto --- .github/workflows/publish-python.yaml | 14 +++++++++++--- .github/workflows/publish-sdk-python.yaml | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-python.yaml b/.github/workflows/publish-python.yaml index 0328a72b3..306f61fb8 100644 --- a/.github/workflows/publish-python.yaml +++ b/.github/workflows/publish-python.yaml @@ -1,6 +1,13 @@ name: Publish nostr-protocol to PyPI -on: [workflow_dispatch] +on: + workflow_dispatch: + inputs: + dry-run: + description: "Compile without publish to PyPI" + type: boolean + default: false + required: true jobs: build-linux-x86_64: @@ -48,7 +55,7 @@ jobs: python: ["3.9", "3.10", "3.11", "3.12"] defaults: run: - working-directory: bindings/nostr-ffi/bindings-python + working-directory: bindings/nostr-ffi/bindings-python steps: - name: "Checkout" uses: actions/checkout@v3 @@ -66,7 +73,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - + - name: "Generate nostr.py and binaries" run: bash ./scripts/generate-linux-aarch64.sh @@ -182,6 +189,7 @@ jobs: run: working-directory: bindings/nostr-ffi/bindings-python needs: [build-linux-x86_64, build-linux-aarch64, build-macos-arm64, build-macos-x86_64, build-windows] + if: github.event.inputs.dry-run == 'false' steps: - name: "Checkout" uses: actions/checkout@v3 diff --git a/.github/workflows/publish-sdk-python.yaml b/.github/workflows/publish-sdk-python.yaml index 4ca18bdec..7313ab36c 100644 --- a/.github/workflows/publish-sdk-python.yaml +++ b/.github/workflows/publish-sdk-python.yaml @@ -1,6 +1,13 @@ name: Publish nostr-sdk to PyPI -on: [workflow_dispatch] +on: + workflow_dispatch: + inputs: + dry-run: + description: "Compile without publish to PyPI" + type: boolean + default: false + required: true jobs: build-linux-x86_64: @@ -48,7 +55,7 @@ jobs: python: ["3.9", "3.10", "3.11", "3.12"] defaults: run: - working-directory: bindings/nostr-sdk-ffi/bindings-python + working-directory: bindings/nostr-sdk-ffi/bindings-python steps: - name: "Checkout" uses: actions/checkout@v3 @@ -66,7 +73,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - + - name: "Generate nostr_sdk.py and binaries" run: bash ./scripts/generate-linux-aarch64.sh @@ -182,6 +189,7 @@ jobs: run: working-directory: bindings/nostr-sdk-ffi/bindings-python needs: [build-linux-x86_64, build-linux-aarch64, build-macos-arm64, build-macos-x86_64, build-windows] + if: github.event.inputs.dry-run == 'false' steps: - name: "Checkout" uses: actions/checkout@v3