diff --git a/.github/workflows/release_build.yml b/.github/workflows/release.yml similarity index 73% rename from .github/workflows/release_build.yml rename to .github/workflows/release.yml index 6b2317e28..f01476721 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release.yml @@ -13,16 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. # -name: Elyra Release - Build +name: Elyra Release on: - workflow_call: + schedule: + - cron: "0 4 * * *" # 4am UTC everyday + pull_request: + branches: [ "**" ] + paths: + - ".github/workflows/release*" + push: + tags: + - v* + workflow_dispatch: inputs: + tag: + type: string + required: true + description: "Tag associated with the release (e.g.: v4.0.0)" dry_run: type: boolean required: true - base_ref: - type: string - required: true + default: true + description: "Indicates if it is a dry run, when artifacts are not published" env: FORCE_COLOR: true @@ -41,7 +53,7 @@ jobs: - name: Check out the repository uses: actions/checkout@v4 with: - ref: ${{ inputs.base_ref }} + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 @@ -57,7 +69,7 @@ jobs: yarn set version ${{ env.YARN_VERSION }} yarn --version - name: Check version - if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }} + if: ${{ github.repository_owner == 'opendatahub-io' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)) }} run: | set -o pipefail LATEST_TAG=$(git describe --tags --match="v*") @@ -70,7 +82,7 @@ jobs: run: | make install-prod - name: Publish package on PyPI - if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }} + if: ${{ github.repository_owner == 'opendatahub-io' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)) }} uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true diff --git a/.github/workflows/release_dry_run.yml b/.github/workflows/release_dry_run.yml deleted file mode 100644 index 483859bd9..000000000 --- a/.github/workflows/release_dry_run.yml +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright 2018-2023 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -name: Elyra Release - Dry Run -on: - workflow_dispatch: - inputs: - tag: - type: string - required: true - description: "Tag or branch associated with the release" - default: "main" - schedule: - - cron: "0 4 * * *" # 4am UTC everyday - pull_request: - branches: ["**"] - paths: - - ".github/workflows/release*" - -concurrency: - group: ${{ github.event.pull_request && format('release-dry-run-pr-{0}', github.event.pull_request.number) || format('release-dry-run-ref-{0}', github.ref_name) }} - cancel-in-progress: true - -jobs: - dry_run: - uses: ./.github/workflows/release_build.yml - with: - dry_run: true - base_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} \ No newline at end of file diff --git a/.github/workflows/release_publish.yml b/.github/workflows/release_publish.yml deleted file mode 100644 index 19b1fc08d..000000000 --- a/.github/workflows/release_publish.yml +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright 2018-2023 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -name: Elyra Release - Publish -on: - push: - tags: - - v* - workflow_dispatch: - inputs: - tag: - type: string - required: true - description: "Tag associated with the release (e.g.: v4.0.0)" - -jobs: - release: - uses: ./.github/workflows/release_build.yml - with: - dry_run: false - base_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}