From c49b29616f37660a90aa17c4ff6692954064e820 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Tue, 2 Apr 2024 11:16:33 +0200 Subject: [PATCH] ci: Set `live-run` input on schedule runs --- .github/workflows/release.yml | 41 +++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 433deda..2d2b8de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,16 +33,25 @@ on: required: false jobs: + setup: + name: Setup + runs-on: ubuntu-latest + outputs: + live-run: ${{ github.event_name == 'schedule' && false || inputs.live-run }} + steps: + - run: echo "Setting up inputs..." + tag: + needs: setup name: Branch, Bump & tag crates uses: eclipse-zenoh/ci/.github/workflows/branch-bump-tag-crates.yml@main with: repo: ${{ github.repository }} - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} version: ${{ inputs.version }} - bump-deps-pattern: ${{ inputs.live-run && 'zenoh.*' || '^$' }} - bump-deps-version: ${{ inputs.live-run && inputs.zenoh-version || '' }} - bump-deps-branch: ${{ inputs.live-run && format('release/{0}', inputs.zenoh-version) || '' }} + bump-deps-pattern: ${{ needs.setup.outputs.live-run && 'zenoh.*' || '^$' }} + bump-deps-version: ${{ needs.setup.outputs.live-run && inputs.zenoh-version || '' }} + bump-deps-branch: ${{ needs.setup.outputs.live-run && format('release/{0}', inputs.zenoh-version) || '' }} secrets: inherit build-debian: @@ -69,29 +78,29 @@ jobs: secrets: inherit cargo: + needs: [setup, tag] name: Publish Cargo crates - needs: tag uses: eclipse-zenoh/ci/.github/workflows/release-crates-cargo.yml@main with: repo: ${{ github.repository }} - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} branch: ${{ needs.tag.outputs.branch }} # - In dry-run mode, we need to publish eclipse-zenoh/zenoh before this # repository, in which case the version of zenoh dependecies are left as # is and thus point to the main branch of eclipse-zenoh/zenoh. # - In live-run mode, we assume that eclipse-zenoh/zenoh is already # published as this workflow can't be responsible for publishing it - unpublished-deps-patterns: ${{ inputs.live-run && '' || 'zenoh.*' }} - unpublished-deps-repos: ${{ inputs.live-run && '' || 'eclipse-zenoh/zenoh' }} + unpublished-deps-patterns: ${{ needs.setup.outputs.live-run && '' || 'zenoh.*' }} + unpublished-deps-repos: ${{ needs.setup.outputs.live-run && '' || 'eclipse-zenoh/zenoh' }} secrets: inherit debian: name: Publish Debian packages - needs: [tag, build-debian] + needs: [setup, tag, build-debian] uses: eclipse-zenoh/ci/.github/workflows/release-crates-debian.yml@main with: no-build: true - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} version: ${{ needs.tag.outputs.version }} repo: ${{ github.repository }} branch: ${{ needs.tag.outputs.branch }} @@ -99,13 +108,13 @@ jobs: secrets: inherit homebrew: + needs: [setup, tag, build-standalone] name: Publish Homebrew formulae - needs: [tag, build-standalone] uses: eclipse-zenoh/ci/.github/workflows/release-crates-homebrew.yml@main with: no-build: true repo: ${{ github.repository }} - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} version: ${{ needs.tag.outputs.version }} branch: ${{ needs.tag.outputs.branch }} artifact-patterns: | @@ -116,11 +125,11 @@ jobs: eclipse: name: Publish artifacts to Eclipse downloads - needs: [tag, build-standalone] + needs: [setup, tag, build-standalone] uses: eclipse-zenoh/ci/.github/workflows/release-crates-eclipse.yml@main with: no-build: true - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} version: ${{ needs.tag.outputs.version }} repo: ${{ github.repository }} branch: ${{ needs.tag.outputs.branch }} @@ -132,11 +141,11 @@ jobs: github: name: Publish artifacts to GitHub Releases - needs: [tag, build-standalone] + needs: [setup, tag, build-standalone] uses: eclipse-zenoh/ci/.github/workflows/release-crates-github.yml@main with: no-build: true - live-run: ${{ inputs.live-run }} + live-run: ${{ needs.setup.outputs.live-run }} version: ${{ needs.tag.outputs.version }} repo: ${{ github.repository }} branch: ${{ needs.tag.outputs.branch }}