Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHOAIENG-15020: Add a dry mode option to the Release workflow #79

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Elyra Build and Release
name: Elyra Release - Build
on:
push:
tags:
- v*
workflow_dispatch:
workflow_call:
inputs:
dry_run:
type: boolean
required: true
base_ref:
type: string
required: true

env:
FORCE_COLOR: true
Expand All @@ -37,6 +41,7 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.base_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -52,6 +57,7 @@ jobs:
yarn set version ${{ env.YARN_VERSION }}
yarn --version
- name: Check version
if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }}
run: |
set -o pipefail
LATEST_TAG=$(git describe --tags --match="v*")
Expand All @@ -64,6 +70,7 @@ jobs:
run: |
make install-prod
- name: Publish package on PyPI
if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# 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 }}
33 changes: 33 additions & 0 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# 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 }}
Loading